1
0
mirror of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git synced 2025-04-01 02:42:39 +08:00

Fix memory leak in CDockContainerWidget::restoreState

delete old root splitter layout item
This commit is contained in:
gafusss 2023-11-03 17:17:58 +03:00 committed by GitHub
parent 420baeedfe
commit 28d4d0f4b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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<CDockSplitter*>(NewRootSplitter);
OldRoot->deleteLater();
delete li;
return true;
}