Add DockWidget::aboutToDelete
Relying on QObject::destroyed might not be a good idea, fixes the
following ASAN issue:
```
SideBar.cpp:80:22: runtime error: downcast of address 0x6040005c8b90
which does not point to an object of type 'DockWidget'
0x6040005c8b90: note: object is of type 'QObject'
00 00 00 00 88 64 e7 43 3f 7f 00 00 a0 ff 0e 00 80 60 00 00
70 81 0c 00 c0 60 00 00 01 be be be
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QObject'
```
This commit is contained in:
@@ -58,6 +58,7 @@ DockWidget::DockWidget(View *view, const QString &name, DockWidgetOptions option
|
||||
|
||||
DockWidget::~DockWidget()
|
||||
{
|
||||
Q_EMIT aboutToDelete(this);
|
||||
DockRegistry::self()->unregisterDockWidget(this);
|
||||
delete d;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user