diff --git a/image_analysis/IndexAndRefine.cpp b/image_analysis/IndexAndRefine.cpp index 41d8d3f4..2eeb781e 100644 --- a/image_analysis/IndexAndRefine.cpp +++ b/image_analysis/IndexAndRefine.cpp @@ -220,11 +220,6 @@ void IndexAndRefine::QuickPredictAndIntegrate(DataMessage &msg, [](const Reflection& a, const Reflection& b) { return a.d < b.d; }); } - { - std::unique_lock ul(reflections_mutex); - reflections[msg.number] = refl_ret; // Image is not processed twice, so thread-safe in principle, but better safe than sorry :) - } - msg.reflections = std::move(refl_ret); CalcISigma(msg); @@ -233,6 +228,11 @@ void IndexAndRefine::QuickPredictAndIntegrate(DataMessage &msg, msg.integration_time_s = std::chrono::duration(integration_end_time - integration_start_time).count(); ScaleImage(msg); + + { + std::unique_lock ul(reflections_mutex); + reflections[msg.number] = msg.reflections; // Image is not processed twice, so thread-safe in principle, but better safe than sorry :) + } } void IndexAndRefine::ProcessImage(DataMessage &msg,