mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-11-15 05:05:43 +08:00
Fix memory leak in CDockContainerWidget::restoreState (#576)
delete old root splitter layout item
This commit is contained in:
parent
420baeedfe
commit
40beef964b
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user