┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Uwe Broulik <[email protected]>2023-09-19 22:43:14 +0200
committerKai Uwe Broulik <[email protected]>2023-09-19 22:43:14 +0200
commit856716e8b6a1de36e85764f25be09f8d49f52d3e (patch)
treefa7e2fff26676112c3e852fcae0e02c50b4c4f2d
parent64e40c1d934247fc9e1c2fa00761b2cb8d70a146 (diff)
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)"
-rw-r--r--src/panels/terminal/terminalpanel.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/panels/terminal/terminalpanel.cpp b/src/panels/terminal/terminalpanel.cpp
index 30c9e8409..04b5b6849 100644
--- a/src/panels/terminal/terminalpanel.cpp
+++ b/src/panels/terminal/terminalpanel.cpp
@@ -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()