Editor: share the SwapManager along with shared buffers
A secondary GUI window shared the primary's buffer vector but attached buffers through its own SwapManager. Closing the window destroyed that manager while buffers still held its recorders, so the next edit called into freed memory; Rehome through the wrong manager also dropped journaling for the primary's buffers. Audit finding M3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015rcVQiiWyTzoNrsvLSaAfB
This commit is contained in:
+1
-1
@@ -378,7 +378,7 @@ GUIFrontend::OpenNewWindow_(Editor &primary)
|
||||
ws->height = h;
|
||||
|
||||
// Secondary editor shares the primary's buffer list
|
||||
ws->editor.SetSharedBuffers(&primary.Buffers());
|
||||
ws->editor.SetSharedBuffers(&primary.Buffers(), primary.Swap());
|
||||
ws->editor.SetDimensions(primary.Rows(), primary.Cols());
|
||||
|
||||
// Open a new untitled buffer and switch to it in the new window.
|
||||
|
||||
Reference in New Issue
Block a user