summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Habacker <ralf.habacker@freenet.de>2016-09-12 21:41:13 (GMT)
committerRalf Habacker <ralf.habacker@freenet.de>2016-09-12 21:41:13 (GMT)
commit4dcf2cfc8a9aa51a93c2014ee3d98514c8442004 (patch)
tree4d23087b4348bb81e5c87583d543683c20e69d84
parentad83879702d80a4e85df7a14f50935dbb1f7d012 (diff)
Fix crash on cleanup of TEST_umlobject.
Removing of UMLObject instance from objects model should be done before partial deleting the instance. In TestBase::cleanupTestCase() delete UMLApp instance at last.
-rw-r--r--umbrello/umlmodel/umlobject.cpp2
-rw-r--r--unittests/testbase.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/umbrello/umlmodel/umlobject.cpp b/umbrello/umlmodel/umlobject.cpp
index 4492fb2..8148b21 100644
--- a/umbrello/umlmodel/umlobject.cpp
+++ b/umbrello/umlmodel/umlobject.cpp
@@ -116,8 +116,8 @@ UMLObject::~UMLObject()
if (stereotype)
stereotype->decrRefCount();
}
- delete m_d;
UMLApp::app()->document()->objectsModel()->remove(this);
+ delete m_d;
}
/**
diff --git a/unittests/testbase.cpp b/unittests/testbase.cpp
index 0ad4679..f2d764d 100644
--- a/unittests/testbase.cpp
+++ b/unittests/testbase.cpp
@@ -52,10 +52,10 @@ void TestBase::initTestCase()
void TestBase::cleanupTestCase()
{
- delete UMLApp::app();
foreach(QObject *p, m_objectsToDelete) {
delete p;
}
+ delete UMLApp::app();
}
void TestBase::cleanupOnExit(QObject *p)