[Uml-devel] KDE/kdesdk/umbrello/umbrello

Sharan Rao sharanrao at gmail.com
Sun Nov 30 11:34:39 UTC 2008


SVN commit 890805 by sharan:

Don't delete the objects directly, but just mark them for deletion. This
prevents catastrophies while iterating over lists which keep changing
their state.


 M  +3 -3      umlview.cpp  


--- trunk/KDE/kdesdk/umbrello/umbrello/umlview.cpp #890804:890805
@@ -766,7 +766,7 @@
         //make sure not in selected list
         m_SelectedList.removeAll(obj);
         m_MessageList.removeAll(obj);
-        delete obj;
+        obj->deleteLater();
     }
 }
 
@@ -884,7 +884,7 @@
         m_MessageList.removeAll(static_cast<MessageWidget*>(o));
     } else
         m_WidgetList.removeAll(o);
-    delete o;
+    o->deleteLater();
     m_pDoc->setModified();
 }
 
@@ -1873,7 +1873,7 @@
 
     pAssoc->cleanup();
     m_AssociationList.removeAll(pAssoc);
-    delete pAssoc;
+    pAssoc->deleteLater();
     m_pDoc->setModified();
 }
 




More information about the umbrello-devel mailing list