diff --git a/core/src/task.cpp b/core/src/task.cpp index 4058fdfc7..cb9b8a803 100644 --- a/core/src/task.cpp +++ b/core/src/task.cpp @@ -46,6 +46,8 @@ #include #include +#include + #include namespace { @@ -234,6 +236,9 @@ void Task::compute() { } moveit::core::MoveItErrorCode Task::plan(size_t max_solutions) { + // ensure that the preempt flag is resetted once this method is exited + auto guard = sg::make_scope_guard([this]() noexcept { this->resetPreemptFlag(); }); + auto impl = pimpl(); init();