Commit e06375db authored by Hartmut Riesenbeck's avatar Hartmut Riesenbeck Committed by Albert Astals Cid
Browse files

Fix segfault on quit

Reproducible segmentation fault when start practice a collection and
quit immediately from statistics main window without changing anything.
The segfault is only shown on console output. DrKonqi window doesn't
open. The segfault appears when ParleyDocument member is deleted in
ParleyMainWindows destructor. The destroyed signal of ParleyDocuments
KEduVocDocument member calls a slot to update the window cation which
want to access an already deleted KEduVocDocument pointer.
To fix this, the destroyed signal connection is removed before deleting
the ParleyDocument member in ParleyMainWindows destructor.

BUG: 420302
(cherry picked from commit 3a8c04e9)
parent 8cb794ca
......@@ -111,6 +111,12 @@ ParleyMainWindow::~ParleyMainWindow()
guiFactory()->removeClient(m_currentComponentWindow);
centralWidget()->layout()->removeWidget(m_currentComponentWindow);
delete m_currentComponentWindow;
// Prevent calling this slot with already deleted m_document as it is no longer needed anyway
if (m_document->document()) {
disconnect(m_document->document().get(), &KEduVocDocument::destroyed,
this, &ParleyMainWindow::slotUpdateWindowCaption);
}
delete m_document;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment