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

Laurent Montel montel at kde.org
Sun Aug 3 10:01:41 UTC 2008


SVN commit 841417 by mlaurent:

Backport:
Fix mem leak


 M  +3 -0      umldoc.cpp  


--- branches/KDE/4.1/kdesdk/umbrello/umbrello/umldoc.cpp #841416:841417
@@ -569,6 +569,7 @@
         if (archive->open(QIODevice::WriteOnly) == false)
         {
             KMessageBox::error(0, i18n("There was a problem saving file: %1", d.path()), i18n("Save Error"));
+            delete archive;
             return false;
         }
 
@@ -578,6 +579,7 @@
         tmp_xmi_file.setAutoRemove(false);
         if ( !tmp_xmi_file.open() ) {
             KMessageBox::error(0, i18n("There was a problem saving file: %1", d.path()), i18n("Save Error"));
+            delete archive;
             return false;
         }
         saveToXMI(tmp_xmi_file); // save XMI to this file...
@@ -594,6 +596,7 @@
 
         if (!archive->close()) {
             KMessageBox::error(0, i18n("There was a problem saving file: %1", d.path()), i18n("Save Error"));
+            delete archive;
             return false;
         }
         // now the xmi file was added to the archive, so we can delete it




More information about the umbrello-devel mailing list