Commit ffdd4bfa authored by Ralf Habacker's avatar Ralf Habacker
Browse files

Fix memory leaks

CCBUG:383592
parent 559917aa
...@@ -32,6 +32,7 @@ ToolBarStateArrow::ToolBarStateArrow(UMLScene *umlScene) ...@@ -32,6 +32,7 @@ ToolBarStateArrow::ToolBarStateArrow(UMLScene *umlScene)
*/ */
ToolBarStateArrow::~ToolBarStateArrow() ToolBarStateArrow::~ToolBarStateArrow()
{ {
cleanup();
} }
/** /**
...@@ -41,6 +42,14 @@ void ToolBarStateArrow::init() ...@@ -41,6 +42,14 @@ void ToolBarStateArrow::init()
{ {
ToolBarState::init(); ToolBarState::init();
cleanup();
}
/**
* Clean up anything before deletion.
*/
void ToolBarStateArrow::cleanup()
{
while (!m_selectionRect.isEmpty()) while (!m_selectionRect.isEmpty())
delete m_selectionRect.takeFirst(); delete m_selectionRect.takeFirst();
m_selectionRect.clear(); m_selectionRect.clear();
......
...@@ -35,6 +35,7 @@ public: ...@@ -35,6 +35,7 @@ public:
virtual ~ToolBarStateArrow(); virtual ~ToolBarStateArrow();
virtual void init(); virtual void init();
void cleanup();
protected: protected:
......
...@@ -225,6 +225,8 @@ void ToolBarStateMessages::setFirstWidget(ObjectWidget* firstObject) ...@@ -225,6 +225,8 @@ void ToolBarStateMessages::setFirstWidget(ObjectWidget* firstObject)
yclick = 0; yclick = 0;
} }
else { else {
if (m_messageLine)
delete m_messageLine;
m_messageLine = new QGraphicsLineItem(); m_messageLine = new QGraphicsLineItem();
m_pUMLScene->addItem(m_messageLine); m_pUMLScene->addItem(m_messageLine);
qreal x = m_pMouseEvent->scenePos().x(); qreal x = m_pMouseEvent->scenePos().x();
......
...@@ -101,6 +101,10 @@ public: ...@@ -101,6 +101,10 @@ public:
~UMLAppPrivate() ~UMLAppPrivate()
{ {
delete logWindow; delete logWindow;
delete stereotypesWindow;
delete objectsWindow;
delete editorWindow;
delete welcomeWindow;
} }
public slots: public slots:
......
...@@ -60,6 +60,10 @@ AssociationLine::AssociationLine(AssociationWidget *association) ...@@ -60,6 +60,10 @@ AssociationLine::AssociationLine(AssociationWidget *association)
*/ */
AssociationLine::~AssociationLine() AssociationLine::~AssociationLine()
{ {
delete m_startSymbol;
delete m_endSymbol;
delete m_subsetSymbol;
removeCollaborationLine();
} }
/** /**
......
...@@ -226,6 +226,7 @@ AssociationWidget* AssociationWidget::create ...@@ -226,6 +226,7 @@ AssociationWidget* AssociationWidget::create
*/ */
AssociationWidget::~AssociationWidget() AssociationWidget::~AssociationWidget()
{ {
cleanup();
delete m_associationLine; delete m_associationLine;
} }
......
...@@ -45,6 +45,7 @@ SeqLineWidget::SeqLineWidget(UMLScene *scene, ObjectWidget * pObject) ...@@ -45,6 +45,7 @@ SeqLineWidget::SeqLineWidget(UMLScene *scene, ObjectWidget * pObject)
*/ */
SeqLineWidget::~SeqLineWidget() SeqLineWidget::~SeqLineWidget()
{ {
cleanupDestructionBox();
} }
/** /**
......
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