Gui: fix a lifetime issue with the draggers
This commit is contained in:
committed by
Kacper Donat
parent
4137df2cee
commit
bde02d6665
@@ -613,7 +613,7 @@ void GizmoContainer::initClass()
|
||||
SO_KIT_INIT_CLASS(GizmoContainer, SoBaseKit, "BaseKit");
|
||||
}
|
||||
|
||||
GizmoContainer::GizmoContainer()
|
||||
GizmoContainer::GizmoContainer(): viewProvider(nullptr)
|
||||
{
|
||||
SO_KIT_CONSTRUCTOR(GizmoContainer);
|
||||
|
||||
@@ -655,7 +655,9 @@ GizmoContainer::~GizmoContainer()
|
||||
|
||||
uninitGizmos();
|
||||
|
||||
viewProvider->setGizmoContainer(nullptr);
|
||||
if (!viewProvider.expired()) {
|
||||
viewProvider->setGizmoContainer(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
void GizmoContainer::initGizmos()
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <QMetaObject>
|
||||
|
||||
#include <Base/Placement.h>
|
||||
#include <Gui/DocumentObserver.h>
|
||||
|
||||
#include <FCGlobal.h>
|
||||
|
||||
@@ -245,7 +246,7 @@ private:
|
||||
std::vector<Gizmo*> gizmos;
|
||||
SoFieldSensor cameraSensor;
|
||||
SoFieldSensor cameraPositionSensor;
|
||||
ViewProviderDragger* viewProvider = nullptr;
|
||||
WeakPtrT<ViewProviderDragger> viewProvider;
|
||||
|
||||
void addGizmo(Gizmo* gizmo);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user