Members of the KDE Community are recommended to subscribe to the kde-community mailing list at to allow them to participate in important discussions and receive other important announcements

Commit fe32a498 authored by Ralf Habacker's avatar Ralf Habacker

Fix memory leak not freeing UMLApp instance.

We use QPointer to avoid access to dangled pointer.

parent 2ec5e2e4
......@@ -85,6 +85,7 @@ int main(int argc, char *argv[])
// NOTE: for deprecated net.sf.umbrello dbus service name
// aboutData.setOrganizationDomain("");
KApplication app;
QPointer<UMLApp> uml;
if (app.isSessionRestored()) {
kRestoreMainWindows< UMLApp >();
} else {
......@@ -97,7 +98,7 @@ int main(int argc, char *argv[])
bool showGUI = getShowGUI(args);
UMLApp* uml = new UMLApp();
uml = new UMLApp();
if (showGUI) {
......@@ -120,7 +121,9 @@ int main(int argc, char *argv[])
exportAllViews(args, exportOpt);
return app.exec();
int result = app.exec();
delete uml;
return result;
bool getShowGUI(KCmdLineArgs *args)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment