Commit 7f44fe35 authored by Ralf Habacker's avatar Ralf Habacker
Browse files

Use a better location for deleting UML Port instance

Using the PortWidget destructor to delete the related uml object is the
wrong place. Instead handle this in UMLScene::deleteSelection().

CCBUG:403515
parent cf5d9e09
......@@ -1507,7 +1507,11 @@ void UMLScene::deleteSelection()
widget->asFloatingTextWidget()->textRole() != Uml::TextRole::Floating) {
widget->setSelectedFlag(false);
widget->hide();
// message widgets are handled later
} else if (widget->isPortWidget()) {
UMLObject *o = widget->umlObject();
removeWidget(widget);
UMLApp::app()->executeCommand(new CmdRemoveUMLObject(o));
// message widgets are handled later
} else if (!widget->isMessageWidget()){
removeWidget(widget);
}
......
......@@ -48,12 +48,6 @@ PortWidget::PortWidget(UMLScene *scene, UMLPort *d, UMLWidget *owner)
*/
PortWidget::~PortWidget()
{
if (m_umlObject) {
// delete related uml object
UMLApp::app()->document()->slotRemoveUMLObject(m_umlObject);
UMLApp::app()->listView()->slotObjectRemoved(m_umlObject);
delete m_umlObject;
}
}
/**
......
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