summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Habacker <[email protected]>2015-05-10 11:03:21 +0200
committerRalf Habacker <[email protected]>2015-05-10 12:41:32 +0200
commitda87d376a0cad8e12e0ae862af43e4f66b30ed60 (patch)
tree337c66f0a889437cb85e92b64ff12b0829ce92ba
parentc765a558338badd29beee430e757921d62b8a4f7 (diff)
Fix memory leaks in class UMLDoc by not deleting class members and not disconnecting signal/slot connections.
CCBUG:347498
-rw-r--r--umbrello/umldoc.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/umbrello/umldoc.cpp b/umbrello/umldoc.cpp
index 05c5cc0..352e4aa 100644
--- a/umbrello/umldoc.cpp
+++ b/umbrello/umldoc.cpp
@@ -150,8 +150,23 @@ void UMLDoc::createDatatypeFolder()
*/
UMLDoc::~UMLDoc()
{
+ UMLApp * pApp = UMLApp::app();
+ disconnect(this, SIGNAL(sigDiagramCreated(Uml::ID::Type)), pApp, SLOT(slotUpdateViews()));
+ disconnect(this, SIGNAL(sigDiagramRemoved(Uml::ID::Type)), pApp, SLOT(slotUpdateViews()));
+ disconnect(this, SIGNAL(sigDiagramRenamed(Uml::ID::Type)), pApp, SLOT(slotUpdateViews()));
+ disconnect(this, SIGNAL(sigCurrentViewChanged()), pApp, SLOT(slotCurrentViewChanged()));
+
+ disconnect(m_pAutoSaveTimer, SIGNAL(timeout()), this, SLOT(slotAutoSave()));
+ delete m_pAutoSaveTimer;
+
+ m_root[Uml::ModelType::Logical]->removeObject(m_datatypeRoot);
delete m_datatypeRoot;
+
+ for (int i = 0; i < Uml::ModelType::N_MODELTYPES; ++i) {
+ delete m_root[i];
+ }
delete m_pChangeLog;
+ qDeleteAll(m_stereoList);
}
/**