From: nds Date: Thu, 27 Aug 2015 14:43:43 +0000 (+0300) Subject: Issue #849 (#775) Crash in second study during sketch operation X-Git-Tag: V_1.4.0_beta4~221 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7bb747315debb04bb5d709e8e4663859a20dfd29;p=modules%2Fshaper.git Issue #849 (#775) Crash in second study during sketch operation Nullify custom operation presentation on viewer closing in SALOME mode. --- diff --git a/src/ModuleBase/ModuleBase_IModule.h b/src/ModuleBase/ModuleBase_IModule.h index cf3177f98..79b702e3e 100644 --- a/src/ModuleBase/ModuleBase_IModule.h +++ b/src/ModuleBase/ModuleBase_IModule.h @@ -146,8 +146,12 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject /// Returns data model object for representation of data tree in Object browser virtual ModuleBase_IDocumentDataModel* dataModel() const = 0; + /// Performs functionality on closing document virtual void closeDocument() = 0; + /// Clears specific presentations in the viewer + virtual void clearViewer() = 0; + /// Returns a list of modes, where the AIS objects should be activated /// \param theModes a list of modes virtual void activeSelectionModes(QIntList& theModes) {} diff --git a/src/NewGeom/NewGeom_Module.cpp b/src/NewGeom/NewGeom_Module.cpp index df5088628..c2cc2b334 100644 --- a/src/NewGeom/NewGeom_Module.cpp +++ b/src/NewGeom/NewGeom_Module.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -289,6 +290,8 @@ void NewGeom_Module::onViewManagerRemoved(SUIT_ViewManager* theMgr) myProxyViewer->setSelector(0); delete mySelector; mySelector = 0; + + myWorkshop->module()->clearViewer(); } } } diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index 6a1e23321..3731b80fd 100755 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -406,6 +406,11 @@ bool PartSet_Module::isMouseOverWindow() } void PartSet_Module::closeDocument() +{ + clearViewer(); +} + +void PartSet_Module::clearViewer() { myCustomPrs->clearPrs(); } diff --git a/src/PartSet/PartSet_Module.h b/src/PartSet/PartSet_Module.h index 449964b4d..9611ee62e 100644 --- a/src/PartSet/PartSet_Module.h +++ b/src/PartSet/PartSet_Module.h @@ -145,8 +145,12 @@ public: /// Returns data model object for representation of data tree in Object browser virtual ModuleBase_IDocumentDataModel* dataModel() const { return myDataModel; } + /// Performs functionality on closing document virtual void closeDocument(); + /// Clears specific presentations in the viewer + virtual void clearViewer(); + /// Event Listener method /// \param theMessage an event message virtual void processEvent(const std::shared_ptr& theMessage);