Fixed a crash when switching from SLA to FDM with a gizmo active

If a gizmo used SupportsClipper or HollowedMesh common data, it would attempt to update from a dead SLAPrintObject
This commit is contained in:
Lukas Matena 2020-06-03 16:37:20 +02:00
parent b8267a5f6f
commit 1e5d1cb616

View File

@ -8,6 +8,8 @@
#include "slic3r/GUI/Camera.hpp" #include "slic3r/GUI/Camera.hpp"
#include "slic3r/GUI/Plater.hpp" #include "slic3r/GUI/Plater.hpp"
#include "slic3r/GUI/PresetBundle.hpp"
#include <GL/glew.h> #include <GL/glew.h>
namespace Slic3r { namespace Slic3r {
@ -170,7 +172,8 @@ void InstancesHider::show_supports(bool show) {
void HollowedMesh::on_update() void HollowedMesh::on_update()
{ {
const ModelObject* mo = get_pool()->selection_info()->model_object(); const ModelObject* mo = get_pool()->selection_info()->model_object();
if (! mo) bool is_sla = wxGetApp().preset_bundle->printers.get_selected_preset().printer_technology() == ptSLA;
if (! mo || ! is_sla)
return; return;
const GLCanvas3D* canvas = get_pool()->get_canvas(); const GLCanvas3D* canvas = get_pool()->get_canvas();
@ -376,7 +379,8 @@ void ObjectClipper::set_position(double pos, bool keep_normal)
void SupportsClipper::on_update() void SupportsClipper::on_update()
{ {
const ModelObject* mo = get_pool()->selection_info()->model_object(); const ModelObject* mo = get_pool()->selection_info()->model_object();
if (! mo) bool is_sla = wxGetApp().preset_bundle->printers.get_selected_preset().printer_technology() == ptSLA;
if (! mo || ! is_sla)
return; return;
const GLCanvas3D* canvas = get_pool()->get_canvas(); const GLCanvas3D* canvas = get_pool()->get_canvas();