diff --git a/sources/editor/elementscene.cpp b/sources/editor/elementscene.cpp index ce6cfbf2c..121c905d5 100644 --- a/sources/editor/elementscene.cpp +++ b/sources/editor/elementscene.cpp @@ -110,6 +110,9 @@ ElementScene::~ElementScene() if (m_decorator) delete m_decorator; + + if (m_paste_area && !m_paste_area->scene()) + delete m_paste_area; } /** diff --git a/sources/editor/styleeditor.cpp b/sources/editor/styleeditor.cpp index e441719bf..1818e8bf5 100644 --- a/sources/editor/styleeditor.cpp +++ b/sources/editor/styleeditor.cpp @@ -386,7 +386,7 @@ StyleEditor::StyleEditor(QETElementEditor *editor, CustomElementGraphicPart *p, outline_color->setSizeAdjustPolicy(QComboBox::AdjustToContents); filling_color->setSizeAdjustPolicy(QComboBox::AdjustToContents); - auto grid_layout = new QGridLayout(this); + auto grid_layout = new QGridLayout(); grid_layout->addWidget(new QLabel(tr("Contour :")), 0,0, Qt::AlignRight); grid_layout->addWidget(outline_color, 0, 1); grid_layout->addWidget(new QLabel(tr("Remplissage :")), 1, 0, Qt::AlignRight); diff --git a/sources/exportdialog.cpp b/sources/exportdialog.cpp index 18fcfc98f..3298ad44c 100644 --- a/sources/exportdialog.cpp +++ b/sources/exportdialog.cpp @@ -112,6 +112,7 @@ ExportDialog::ExportDialog( */ ExportDialog::~ExportDialog() { + qDeleteAll(diagram_lines_); } /** diff --git a/sources/genericpanel.cpp b/sources/genericpanel.cpp index da40a343a..dbb856b75 100644 --- a/sources/genericpanel.cpp +++ b/sources/genericpanel.cpp @@ -321,9 +321,11 @@ QTreeWidgetItem *GenericPanel::getItemForDiagram(Diagram *diagram, if (created) *created = false; return(diagram_qtwi); } - + + if (!created) return(nullptr); + diagram_qtwi = makeItem(QET::Diagram); - if (created) *created = true; + *created = true; return(diagram_qtwi); }