jporcher 2023-12-05 14:44:31 +01:00 committed by GitHub
parent ec018a4c70
commit a7a97e6978
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -1,5 +1,5 @@
#include <QApplication>
#include "../../examples/simple/MainWindow.h"
#include "mainframe.h"
int main(int argc, char *argv[])
{

View File

@ -539,7 +539,14 @@ CDockManager::~CDockManager()
std::vector<ads::CDockAreaWidget*> areas;
for ( int i = 0; i != dockAreaCount(); ++i )
{
areas.push_back( dockArea(i) );
auto area = dockArea(i);
if ( area->dockManager() == this )
areas.push_back( area );
// else, this is surprising, looks like this CDockAreaWidget is child of two different CDockManager
// this is reproductible by https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/issues/585 testcase
// then, when a CDockManager deletes itself, it deletes the CDockAreaWidget, then, the other
// CDockManager will try to delete the CDockAreaWidget again and this will crash
// So let's just delete CDockAreaWidget we are the parent of!
}
for ( auto area : areas )
{