mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-11-15 13:15:43 +08:00
Fixed crash caused by changes related to issue #594 - deletion of CFloatingWidget caused crash when loading a state from XML
This commit is contained in:
parent
ed6636ae26
commit
644c828f00
@ -566,6 +566,7 @@ CDockManager::~CDockManager()
|
||||
auto FloatingWidgets = d->FloatingWidgets;
|
||||
for (auto FloatingWidget : FloatingWidgets)
|
||||
{
|
||||
FloatingWidget->deleteContent();
|
||||
delete FloatingWidget;
|
||||
}
|
||||
|
||||
|
@ -760,10 +760,22 @@ CFloatingDockContainer::CFloatingDockContainer(CDockWidget *DockWidget) :
|
||||
d->DockManager->notifyWidgetOrAreaRelocation(DockWidget);
|
||||
}
|
||||
|
||||
|
||||
//============================================================================
|
||||
CFloatingDockContainer::~CFloatingDockContainer()
|
||||
{
|
||||
ADS_PRINT("~CFloatingDockContainer");
|
||||
if (d->DockManager)
|
||||
{
|
||||
d->DockManager->removeFloatingWidget(this);
|
||||
}
|
||||
delete d;
|
||||
}
|
||||
|
||||
|
||||
//============================================================================
|
||||
void CFloatingDockContainer::deleteContent()
|
||||
{
|
||||
std::vector<QPointer<ads::CDockAreaWidget>> areas;
|
||||
for (int i = 0; i != dockContainer()->dockAreaCount(); ++i)
|
||||
{
|
||||
@ -788,12 +800,6 @@ CFloatingDockContainer::~CFloatingDockContainer()
|
||||
delete ptrWdg;
|
||||
}
|
||||
}
|
||||
|
||||
if (d->DockManager)
|
||||
{
|
||||
d->DockManager->removeFloatingWidget(this);
|
||||
}
|
||||
delete d;
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
|
@ -146,6 +146,13 @@ protected:
|
||||
*/
|
||||
virtual void finishDragging() override;
|
||||
|
||||
/**
|
||||
* This function deletes all dock widgets in it.
|
||||
* This functions should be called only from dock manager in its
|
||||
* destructor before deleting the floating widget
|
||||
*/
|
||||
void deleteContent();
|
||||
|
||||
/**
|
||||
* Call this function if you just want to initialize the position
|
||||
* and size of the floating widget
|
||||
|
Loading…
Reference in New Issue
Block a user