From e8d8fb5c7a31029691f10f3d635a6f4941bafc89 Mon Sep 17 00:00:00 2001 From: "songwei.li" Date: Fri, 22 Aug 2025 11:24:42 +0800 Subject: [PATCH] FIX: the exported Gcode file is stuck when imported on Mac suppressed_backround_processing_update when loading gcode to prevent deadlock. jira: STUDIO-13899 Change-Id: Iad4f20cd5249bb5133146197bb1bc32101b08bdf (cherry picked from commit 2579cdc7adb98c1f21c3169a9fcebba60597fb43) (cherry picked from commit 13b14414e03e3907d9d1662cdab570c754200618) --- src/slic3r/GUI/GCodeViewer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 42a4c5d15e..5926b61ec5 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -961,12 +961,14 @@ void GCodeViewer::load(const GCodeProcessorResult& gcode_result, const Print& pr reset(); //BBS: add mutex for protection of gcode result + wxGetApp().plater()->suppress_background_process(true); gcode_result.lock(); //BBS: add safe check if (gcode_result.moves.size() == 0) { //result cleaned before slicing ,should return here BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format(": gcode result reset before, return directly!"); gcode_result.unlock(); + wxGetApp().plater()->schedule_background_process(); return; } @@ -1002,6 +1004,7 @@ void GCodeViewer::load(const GCodeProcessorResult& gcode_result, const Print& pr //BBS: add mutex for protection of gcode result if (m_layers.empty()) { gcode_result.unlock(); + wxGetApp().plater()->schedule_background_process(); return; } @@ -1104,6 +1107,7 @@ void GCodeViewer::load(const GCodeProcessorResult& gcode_result, const Print& pr filament_printable_reuslt = gcode_result.filament_printable_reuslt; //BBS: add mutex for protection of gcode result gcode_result.unlock(); + wxGetApp().plater()->schedule_background_process(); //BBS: add logs BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": finished, m_buffers size %1%!")%m_buffers.size(); }