diff --git a/otherarch/sdcpp/sdtype_adapter.cpp b/otherarch/sdcpp/sdtype_adapter.cpp index 8c66b49ea..6b7c4cca3 100644 --- a/otherarch/sdcpp/sdtype_adapter.cpp +++ b/otherarch/sdcpp/sdtype_adapter.cpp @@ -1771,11 +1771,11 @@ sd_generation_outputs sdtype_generate(const sd_generation_inputs inputs) static void step_callback(int step, int frame_count, sd_image_t* image, bool is_noisy, void* data) { + std::lock_guard lock(geninfo.mux); double step_time = get_time_delta(geninfo.start_time); bool should_encode_preview = false; { - std::lock_guard lock(geninfo.mux); if (geninfo.gendata.status <= 1) { geninfo.gendata.status = 2; if (geninfo.preview_requested && !geninfo.preview_enabled) { @@ -1811,7 +1811,6 @@ static void step_callback(int step, int frame_count, sd_image_t* image, bool is_ } { - std::lock_guard lock(geninfo.mux); geninfo.gendata.step = step; geninfo.gendata.step_time = step_time; geninfo.gendata.preview = preview;