diff --git a/src/DockContainerWidget.cpp b/src/DockContainerWidget.cpp index b7f8b2f..85ce8ea 100644 --- a/src/DockContainerWidget.cpp +++ b/src/DockContainerWidget.cpp @@ -1932,10 +1932,11 @@ bool CDockContainerWidget::restoreState(CDockingStateReader& s, bool Testing) NewRootSplitter = d->newSplitter(Qt::Horizontal); } - d->Layout->replaceWidget(d->RootSplitter, NewRootSplitter); + QLayoutItem* li = d->Layout->replaceWidget(d->RootSplitter, NewRootSplitter); auto OldRoot = d->RootSplitter; d->RootSplitter = qobject_cast(NewRootSplitter); OldRoot->deleteLater(); + delete li; return true; }