[Kst] extragear/graphics/kst/kst

Andrew Walker arwalker at sumusltd.com
Wed Dec 21 00:16:04 CET 2005


SVN commit 490156 by arwalker:

prevent a reference count problem where deleting a plot via the context menu would result in the associated curves still being marked as in use in the data manager. The solution is to release _pressTarget if necessary

 M  +2 -1      ksttoplevelview.h  
 M  +4 -0      kstviewobject.cpp  


--- trunk/extragear/graphics/kst/kst/ksttoplevelview.h #490155:490156
@@ -59,7 +59,8 @@
 
     KstViewObjectList& selectionList() { return _selectionList; }
     KstViewObjectPtr pressTarget() const { return _pressTarget; }
-
+    void clearPressTarget() { _pressTarget = 0L; }
+    
     template<class T> KstSharedPtr<T> createPlot(const QString& name, bool doCleanup = true);
 
     bool mouseGrabbed() const { return _mouseGrabbed; }
--- trunk/extragear/graphics/kst/kst/kstviewobject.cpp #490155:490156
@@ -1109,6 +1109,10 @@
   KstApp::inst()->document()->setModified();
   KstViewObjectPtr vop(this);
   if (_topObjectForMenu) {
+    KstTopLevelViewPtr tlv = kst_cast<KstTopLevelView>(KstViewObjectPtr(_topObjectForMenu));
+    if (tlv && vop == tlv->pressTarget()) {
+      tlv->clearPressTarget();
+    }
     _topObjectForMenu->removeChild(this, true);
     _topObjectForMenu = 0L;
   }


More information about the Kst mailing list