Commit c55cebc9 authored by Ralf Habacker's avatar Ralf Habacker

Fix 'Stereotype reference count issue on close, open or new document'.

We also need to avoid dangled stereotype pointer by using
a QPointer instance for UMLObject::m_stereotype.

FIXED-IN:2.17.2 (KDE Applications 15.08.2)
BUG:345546
parent 8801f798
......@@ -406,14 +406,13 @@ void UMLDoc::closeDocument()
createDatatypeFolder();
// this creates to much items only Logical View should be created
listView->init();
/* Remove any stereotypes.
if (m_stereoList.count() > 0) {
UMLStereotype *s;
for (UMLStereotypeListIt sit(m_stereoList); (s = sit.current()) != 0; ++sit)
// Remove any stereotypes.
if (stereotypes().count() > 0) {
foreach(UMLStereotype *s, stereotypes())
delete s;
m_stereoList.clear();
}
*/
}
m_bClosing = false;
}
......
......@@ -172,7 +172,7 @@ protected:
Uml::ID::Type m_nId; ///< object's id
QString m_Doc; ///< object's documentation
UMLPackage* m_pUMLPackage; ///< package the object belongs to if applicable
UMLStereotype* m_pStereotype; ///< stereotype of the object if applicable
QPointer<UMLStereotype> m_pStereotype; ///< stereotype of the object if applicable
QString m_name; ///< objects name
ObjectType m_BaseType; ///< objects type
Uml::Visibility::Enum m_visibility; ///< objects visibility
......
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