]> cloud.milkyroute.net Git - dolphin.git/commitdiff
terminalpanel.cpp: Set m_konsolePart to nullptr during exit signal
authorAkseli Lahtinen <akselmo@akselmo.dev>
Wed, 10 Jan 2024 09:22:46 +0000 (09:22 +0000)
committerAkseli Lahtinen <akselmo@akselmo.dev>
Wed, 10 Jan 2024 09:22:46 +0000 (09:22 +0000)
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

src/panels/terminal/terminalpanel.cpp

index fd9873ee917ee8650c8c5c9dd33bf7b8e0cbe717..e9184e7389a10850ee7b87019fe05e697a4757c4 100644 (file)
@@ -70,6 +70,7 @@ bool TerminalPanel::currentWorkingDirectoryIsChildOf(const QString &path) const
 void TerminalPanel::terminalExited()
 {
     m_terminal = nullptr;
+    m_konsolePart = nullptr;
     Q_EMIT hideTerminalPanel();
 }