[Uml-devel] kdesdk/umbrello/umbrello

Brian Thomas thomas at mail630.gsfc.nasa.gov
Tue Sep 30 12:23:07 UTC 2003


CVS commit by thomas: 

bug fix: associations not properly deleted when selected in the view. This is caused by assocwidget->cleanup having 'delete UMLAssoc' commented out (because removing the child UMLAssoc in clean causes problems with cut n paste ops). Reverted to old method of deleting from the view. In general, this seems bad to me.. we should only let the owning objects delete their children. Especially when the child isnt pointed to by anything else (as I believe is true for UMLAssociaions).


  M +7 -9      umlview.cpp   1.98


--- kdesdk/umbrello/umbrello/umlview.cpp  #1.97:1.98
@@ -1927,7 +1927,9 @@ void UMLView::removeAssocInViewAndDoc(As
         if(!a)
                 return;
-        // Remove the association from the UMLDoc.
-        // NO! now done by the association->cleanup.
-        // m_pDoc->removeAssociation(a->getAssociation());
+
+        // Ah, its back. Apparently cut-n-paste ops crash if 
+        // we delete associations from within the association widget
+        // cleanup method (below)
+        m_pDoc->removeAssociation(a->getAssociation()); // Remove the association from the UMLDoc.
 
         // Remove the association in this view.
@@ -1933,11 +1935,7 @@ void UMLView::removeAssocInViewAndDoc(As
         // Remove the association in this view.
         a->cleanup();
+
         m_AssociationList.remove(a);
-/*      if (deleteLater) {
-                a->deleteLater();
-        }
-        else
-                delete a;
- */
+
 }
 






More information about the umbrello-devel mailing list