mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-01 07:14:14 +02:00
fbb59ee1e7
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>