From 8ecb2163b638c212a7549c752d98a188f138fb03 Mon Sep 17 00:00:00 2001 From: bubnikv Date: Tue, 20 Nov 2018 15:18:46 +0100 Subject: [PATCH] Hopefully a fix of OSX compilation issue. --- src/libslic3r/PrintBase.cpp | 5 ----- src/libslic3r/PrintBase.hpp | 11 ++++++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/libslic3r/PrintBase.cpp b/src/libslic3r/PrintBase.cpp index 7ae5b1f9f..a44f42fbd 100644 --- a/src/libslic3r/PrintBase.cpp +++ b/src/libslic3r/PrintBase.cpp @@ -15,9 +15,4 @@ std::function PrintObjectBase::cancel_callback(PrintBase *print) return print->cancel_callback(); } -void PrintObjectBase::throw_if_canceled(PrintBase *print) -{ - print->throw_if_canceled(); -} - } // namespace Slic3r diff --git a/src/libslic3r/PrintBase.hpp b/src/libslic3r/PrintBase.hpp index 435b50dd3..94c732c0b 100644 --- a/src/libslic3r/PrintBase.hpp +++ b/src/libslic3r/PrintBase.hpp @@ -190,9 +190,6 @@ protected: // Declared here to allow access from PrintBase through friendship. static tbb::mutex& state_mutex(PrintBase *print); static std::function cancel_callback(PrintBase *print); - // If the background processing stop was requested, throw CanceledException. - // To be called by the worker thread and its sub-threads (mostly launched on the TBB thread pool) regularly. - static void throw_if_canceled(PrintBase *print); ModelObject *m_model_object; }; @@ -353,9 +350,9 @@ protected: PrintObjectBaseWithState(PrintType *print, ModelObject *model_object) : PrintObjectBase(model_object), m_print(print) {} bool set_started(PrintObjectStepEnum step) - { return m_state.set_started(step, PrintObjectBase::state_mutex(m_print), [this](){ PrintObjectBase::throw_if_canceled(this->m_print); }); } + { return m_state.set_started(step, PrintObjectBase::state_mutex(m_print), [this](){ this->throw_if_canceled(); }); } PrintStateBase::TimeStamp set_done(PrintObjectStepEnum step) - { return m_state.set_done(step, PrintObjectBase::state_mutex(m_print), [this](){ PrintObjectBase::throw_if_canceled(this->m_print); }); } + { return m_state.set_done(step, PrintObjectBase::state_mutex(m_print), [this](){ this->throw_if_canceled(); }); } bool invalidate_step(PrintObjectStepEnum step) { return m_state.invalidate(step, PrintObjectBase::cancel_callback(m_print)); } @@ -368,6 +365,10 @@ protected: { return m_state.invalidate_all(PrintObjectBase::cancel_callback(m_print)); } protected: + // If the background processing stop was requested, throw CanceledException. + // To be called by the worker thread and its sub-threads (mostly launched on the TBB thread pool) regularly. + void throw_if_canceled() { if (m_print->canceled()) throw CanceledException(); } + friend PrintType; PrintType *m_print;