fix: make undo history fields atomic and protect clip buffer access in save/load thread

Co-authored-by: aider (deepseek/deepseek-coder) <aider@aider.chat>
This commit is contained in:
Loic Coenen
2026-05-02 11:19:33 +00:00
parent fde1a5cb04
commit b6cea54a89
2 changed files with 47 additions and 30 deletions

View File

@@ -97,9 +97,9 @@ typedef struct {
typedef struct {
UndoAction actions[MAX_UNDO_HISTORY];
int undo_index; // Points to next action to undo
int redo_index; // Points to next action to redo
int count; // Total actions in history
atomic_int undo_index; // Points to next action to undo
atomic_int redo_index; // Points to next action to redo
atomic_int count; // Total actions in history
} UndoHistory;
typedef struct {