1
0
mirror of https://invent.kde.org/system/dolphin synced 2024-07-07 10:51:45 +00:00

TerminalPanel: Disconnect destroyed signal in destructor

Otherwise, when QObject cleanup, which runs after our destructor,
destroys the terminalPart, it would call back into us
when we're already half-destroyed.

This trips an assert in Qt "Called object is not of the correct
type (class destructor may have already run)"
This commit is contained in:
Kai Uwe Broulik 2023-09-19 22:43:14 +02:00
parent 64e40c1d93
commit 856716e8b6

View File

@ -47,6 +47,9 @@ TerminalPanel::TerminalPanel(QWidget *parent)
TerminalPanel::~TerminalPanel()
{
// Avoid when QObject cleanup, which comes after our destructor, deletes the konsolePart
// and subsequently calls back into our slot when the destructor has already run.
disconnect(m_konsolePart, &KParts::ReadOnlyPart::destroyed, this, &TerminalPanel::terminalExited);
}
void TerminalPanel::goHome()