fix crash on application close

This commit is contained in:
Sen66
2026-03-05 14:25:06 +01:00
parent f06abbab79
commit b53dea8f9f

View File

@@ -1668,10 +1668,11 @@ MainWindow::~MainWindow() {
*
*/
// Disconnect all dock destroyed signals before members are torn down,
// Disconnect all signals before members are torn down,
// so the lambdas capturing 'this' never fire on a half-destroyed object.
for (auto it = m_tabs.begin(); it != m_tabs.end(); ++it) {
disconnect(it.key(), &QObject::destroyed, this, nullptr);
disconnect(&it->doc->undoStack, nullptr, this, nullptr);
// Release providers now while plugin DLLs are still loaded;
// if deferred to Qt child cleanup the DLL code may already be unloaded.
it->doc->provider.reset();