┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/panels
diff options
context:
space:
mode:
authorAkseli Lahtinen <[email protected]>2024-01-10 09:22:46 +0000
committerAkseli Lahtinen <[email protected]>2024-01-10 09:22:46 +0000
commit1a59905027e578e396216b1f11831c80ec87db4f (patch)
tree5ebe4e5e1027f8656f86e4cfc0da1252a852541d /src/panels
parent7e02110c64b178f16519ee3be6a4d460e967236d (diff)
terminalpanel.cpp: Set m_konsolePart to nullptr during exit signal
If Dolphin terminal is open, and one types `exit` there and then closes Dolphin, Dolphin crashes due to a dangling pointer. Konsole KPart is deleting itself when Konsole session exits, but Dolphin tracks it as a child of the Terminal Panel. The Terminal Panel doesn't get destroyed when Konsole KPart does, and it tries to double free during children clean up. (Thanks @sitter !) Setting `m_konsolePart` to `nullptr` during exit signal fixes this, since there is already check in place for that in the destructor. BUG:479596
Diffstat (limited to 'src/panels')
-rw-r--r--src/panels/terminal/terminalpanel.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/panels/terminal/terminalpanel.cpp b/src/panels/terminal/terminalpanel.cpp
index fd9873ee9..e9184e738 100644
--- a/src/panels/terminal/terminalpanel.cpp
+++ b/src/panels/terminal/terminalpanel.cpp
@@ -70,6 +70,7 @@ bool TerminalPanel::currentWorkingDirectoryIsChildOf(const QString &path) const
void TerminalPanel::terminalExited()
{
m_terminal = nullptr;
+ m_konsolePart = nullptr;
Q_EMIT hideTerminalPanel();
}