From 797c812f311717fd59343ce171d0f2c24a4b0b4f Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Tue, 3 Jul 2018 13:12:15 +0200 Subject: [PATCH] Stop the ongoing slicing process when attempting to export. --- lib/Slic3r/GUI/MainFrame.pm | 1 + xs/src/slic3r/AppController.cpp | 10 ++++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/Slic3r/GUI/MainFrame.pm b/lib/Slic3r/GUI/MainFrame.pm index 47e3bdc22..66e232be7 100644 --- a/lib/Slic3r/GUI/MainFrame.pm +++ b/lib/Slic3r/GUI/MainFrame.pm @@ -398,6 +398,7 @@ sub on_plater_selection_changed { sub slice_to_png { my $self = shift; + $self->{plater}->stop_background_process; $self->{plater}->async_apply_config; $appController->print_ctl()->slice_to_png(); } diff --git a/xs/src/slic3r/AppController.cpp b/xs/src/slic3r/AppController.cpp index 50a910773..2b71a6f11 100644 --- a/xs/src/slic3r/AppController.cpp +++ b/xs/src/slic3r/AppController.cpp @@ -20,9 +20,7 @@ namespace Slic3r { class AppControllerBoilerplate::PriData { public: -// using M = std::unordered_map; std::mutex m; -// M store; std::thread::id ui_thread; inline explicit PriData(std::thread::id uit): ui_thread(uit) {} @@ -328,9 +326,9 @@ void PrintController::slice_to_png() } } - std::async(supports_asynch()? std::launch::async : std::launch::deferred, - [this, exd, scale_back]() - { +// std::async(supports_asynch()? std::launch::async : std::launch::deferred, +// [this, exd, scale_back]() +// { auto pri = create_progress_indicator( 200, _(L("Slicing to zipped png files..."))); @@ -362,7 +360,7 @@ void PrintController::slice_to_png() print_->progressindicator = pbak; scale_back(); - }); +// }); } void IProgressIndicator::message_fmt(