diff --git a/src/Gui/DAGView/DAGView.cpp b/src/Gui/DAGView/DAGView.cpp index d026e245f5..a69eec18a7 100644 --- a/src/Gui/DAGView/DAGView.cpp +++ b/src/Gui/DAGView/DAGView.cpp @@ -56,8 +56,8 @@ View::View(QWidget* parentIn): QGraphicsView(parentIn) { this->setRenderHint(QPainter::Antialiasing, true); this->setRenderHint(QPainter::TextAntialiasing, true); - Application::Instance->signalActiveDocument.connect(boost::bind(&View::slotActiveDocument, this, bp::_1)); - Application::Instance->signalDeleteDocument.connect(boost::bind(&View::slotDeleteDocument, this, bp::_1)); + conActive = Application::Instance->signalActiveDocument.connect(boost::bind(&View::slotActiveDocument, this, bp::_1)); + conDelete = Application::Instance->signalDeleteDocument.connect(boost::bind(&View::slotDeleteDocument, this, bp::_1)); //just update the dagview when the gui process is idle. connect(QAbstractEventDispatcher::instance(), SIGNAL(awake()), this, SLOT(awakeSlot())); @@ -65,8 +65,6 @@ View::View(QWidget* parentIn): QGraphicsView(parentIn) View::~View() { - Application::Instance->signalActiveDocument.disconnect(boost::bind(&View::slotActiveDocument, this, bp::_1)); - Application::Instance->signalDeleteDocument.disconnect(boost::bind(&View::slotDeleteDocument, this, bp::_1)); } void View::slotActiveDocument(const Document &documentIn) diff --git a/src/Gui/DAGView/DAGView.h b/src/Gui/DAGView/DAGView.h index 610bedf4c7..7a82dbe415 100644 --- a/src/Gui/DAGView/DAGView.h +++ b/src/Gui/DAGView/DAGView.h @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -56,6 +57,8 @@ namespace Gui typedef std::map > ModelMap; ModelMap modelMap; + boost::signals2::scoped_connection conActive; + boost::signals2::scoped_connection conDelete; }; //! @brief dock window for DAG viewer @@ -64,7 +67,7 @@ namespace Gui Q_OBJECT public: DockWindow(Gui::Document* gDocumentIn = 0, QWidget *parent = 0); - ~DockWindow(){}; + ~DockWindow(){} private: View *dagView;