Files
qelectrotech-source-mirror/sources/TerminalStrip
ispyisail fbb59ee1e7 Fix a crash when closing a project after its terminal strip window is gone
The terminal strip window's tree dock connects to its project's
destroyed() signal with a lambda capturing `this`, but without `this`
as the connection's context, and never disconnects it. When the dock is
deleted before the project, closing the project runs the lambda on
freed memory.

The terminal strip window is a single instance, parented to the editor
window it was first opened from. With two editor windows:

1. open the terminal strip manager from window 1 (project A);
2. open it from window 2 (project B): the same window switches to B,
   still a child of window 1;
3. close window 1: the terminal strip window and its dock are deleted,
   the connection to B stays;
4. close window 2, or project B: heap-use-after-free in the lambda
   (terminalstriptreedockwidget.cpp:66), reported by AddressSanitizer
   3 times out of 3. Freed by ~TerminalStripEditorWindow from
   ~QETDiagramEditor.

Passing `this` as the context removes the connection with the dock, as
FreeTerminalEditor, FreeTerminalModel and TerminalStripEditor already
do for the same signal. With the fix: no error, 3 times out of 3.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-30 09:22:05 +13:00
..
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00