mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-23 06:33:57 -06:00
Implement exception rethrow for ui jobs
This commit is contained in:
parent
264ce71e94
commit
56e7d83513
11 changed files with 112 additions and 51 deletions
|
@ -2,6 +2,7 @@
|
|||
#define JOB_HPP
|
||||
|
||||
#include <atomic>
|
||||
#include <exception>
|
||||
|
||||
#include "libslic3r/libslic3r.h"
|
||||
|
||||
|
@ -32,8 +33,9 @@ class Job : public wxEvtHandler
|
|||
std::atomic<bool> m_running{false}, m_canceled{false};
|
||||
bool m_finalized = false;
|
||||
std::shared_ptr<ProgressIndicator> m_progress;
|
||||
std::exception_ptr m_worker_error = nullptr;
|
||||
|
||||
void run();
|
||||
void run(std::exception_ptr &);
|
||||
|
||||
protected:
|
||||
// status range for a particular job
|
||||
|
@ -49,6 +51,8 @@ protected:
|
|||
|
||||
// Launched when the job is finished. It refreshes the 3Dscene by def.
|
||||
virtual void finalize() { m_finalized = true; }
|
||||
|
||||
virtual void on_exception(const std::exception_ptr &) {}
|
||||
|
||||
public:
|
||||
Job(std::shared_ptr<ProgressIndicator> pri);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue