mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-11-15 13:15:43 +08:00
Fixed #594 - Destruction of CDockWidget inside a CFloatingDockContainer
This commit is contained in:
parent
5b23248fb8
commit
7abc698d09
@ -764,6 +764,31 @@ CFloatingDockContainer::CFloatingDockContainer(CDockWidget *DockWidget) :
|
|||||||
CFloatingDockContainer::~CFloatingDockContainer()
|
CFloatingDockContainer::~CFloatingDockContainer()
|
||||||
{
|
{
|
||||||
ADS_PRINT("~CFloatingDockContainer");
|
ADS_PRINT("~CFloatingDockContainer");
|
||||||
|
std::vector<QPointer<ads::CDockAreaWidget>> areas;
|
||||||
|
for (int i = 0; i != dockContainer()->dockAreaCount(); ++i)
|
||||||
|
{
|
||||||
|
areas.push_back( dockContainer()->dockArea(i) );
|
||||||
|
}
|
||||||
|
for (auto area : areas)
|
||||||
|
{
|
||||||
|
if (!area)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// QPointer delete safety - just in case some dock wigdet in destruction
|
||||||
|
// deletes another related/twin or child dock widget.
|
||||||
|
std::vector<QPointer<QWidget>> deleteWidgets;
|
||||||
|
for (auto widget : area->dockWidgets())
|
||||||
|
{
|
||||||
|
deleteWidgets.push_back(widget);
|
||||||
|
}
|
||||||
|
for (auto ptrWdg : deleteWidgets)
|
||||||
|
{
|
||||||
|
delete ptrWdg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (d->DockManager)
|
if (d->DockManager)
|
||||||
{
|
{
|
||||||
d->DockManager->removeFloatingWidget(this);
|
d->DockManager->removeFloatingWidget(this);
|
||||||
|
Loading…
Reference in New Issue
Block a user