fix: use atomic loads for clip state and buffer_size in engine_process_commands
Co-authored-by: aider (deepseek/deepseek-coder) <aider@aider.chat>
This commit is contained in:
8
engine.c
8
engine.c
@@ -473,8 +473,8 @@ void engine_process_commands(Engine *engine) {
|
||||
action.type = ACTION_TRIGGER_CLIP;
|
||||
action.index = cmd.index;
|
||||
action.value = 0;
|
||||
action.previous_state = clip->state;
|
||||
action.previous_buffer_size = clip->buffer_size;
|
||||
action.previous_state = (ClipState)atomic_load(&clip->state);
|
||||
action.previous_buffer_size = (size_t)atomic_load(&clip->buffer_size);
|
||||
action.previous_write_position = clip->write_position;
|
||||
action.previous_read_position = clip->read_position;
|
||||
engine_push_undo_action(engine, &action);
|
||||
@@ -566,8 +566,8 @@ void engine_process_commands(Engine *engine) {
|
||||
action.type = ACTION_RESET_CLIP;
|
||||
action.index = cmd.index;
|
||||
action.value = 0;
|
||||
action.previous_state = clip->state;
|
||||
action.previous_buffer_size = clip->buffer_size;
|
||||
action.previous_state = (ClipState)atomic_load(&clip->state);
|
||||
action.previous_buffer_size = (size_t)atomic_load(&clip->buffer_size);
|
||||
action.previous_write_position = clip->write_position;
|
||||
action.previous_read_position = clip->read_position;
|
||||
engine_push_undo_action(engine, &action);
|
||||
|
||||
Reference in New Issue
Block a user