Bug 141602

Summary: Umbrello crashes when deleting the link between a package and a class
Product: [Applications] umbrello Reporter: Sébastien Watteau <sebastien.watteau>
Component: generalAssignee: Oliver Kellogg <okellogg>
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Sébastien Watteau 2007-02-12 18:56:42 UTC
Version:           1.5.6 (using KDE KDE 3.5.6)
Installed from:    Unlisted Binary Package
OS:                Linux

Umbrello terminates with SIGSEGV when attempting to link a package and a class.

To reproduce this bug:
- Create a new package
- Create a new class
- Select the "Containment" line in the toolbar and draw a line beetween the package and the class
Comment 1 Oliver Kellogg 2007-02-12 19:32:35 UTC
With 1.5.61, creation of containment is okay but deletion crashes.
Comment 2 Oliver Kellogg 2007-02-12 21:30:49 UTC
SVN commit 632977 by okellogg:

removeAssocInViewAndDoc(): UMLListView::moveObject() will delete the containment
 AssociationWidget via UMLView::updateContainment().
BUG:141602


 M  +1 -0      ChangeLog  
 M  +4 -2      umbrello/umlview.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/ChangeLog #632976:632977
@@ -1,6 +1,7 @@
 Version 1.5.7
 * Bugs fixed from http://bugs.kde.org:
 * Javascript Code Generation creates bad format methods (135540)
+* Crash when deleting the link between a package and a class (141602)
 
 Version 1.5.61
 
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umlview.cpp #632976:632977
@@ -1767,6 +1767,8 @@
             lv->moveObject( objToBeMoved->getID(),
                             Model_Utils::convert_OT_LVT(objToBeMoved),
                             lv->theLogicalView() );
+            // UMLListView::moveObject() will delete the containment
+            // AssociationWidget via UMLView::updateContainment().
         } else {
             kDebug() << "removeAssocInViewAndDoc(containment): "
                       << "objB is NULL" << endl;
@@ -1774,9 +1776,9 @@
     } else {
         // Remove assoc in doc.
         m_pDoc->removeAssociation(a->getAssociation());
+        // Remove assoc in view.
+        removeAssoc(a);
     }
-    // Remove assoc in view.
-    removeAssoc(a);
 }
 
 /** Removes all the associations related to Widget */