diff options
author | Robin Gareus <robin@gareus.org> | 2016-02-09 21:36:49 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-02-09 21:36:49 +0100 |
commit | 1ec78d26ee7cd5a612a7f98f9977dbb8ef46a593 (patch) | |
tree | 4a9ffbb83e2ddb927ba0b21b42c8c8b516ea29a9 /libs/ardour/ardour/export_status.h | |
parent | d56a44bf362ec338b97808390fdf6190d0920fad (diff) |
Fix crash when aborting export.
The "Stop" button results in ExportHandlerPtr being destroyed.
This must not happen while it's in use -- in particular during
ExportHandler::start_timespan() and ExportHandler::finish_timespan()
Diffstat (limited to 'libs/ardour/ardour/export_status.h')
-rw-r--r-- | libs/ardour/ardour/export_status.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/libs/ardour/ardour/export_status.h b/libs/ardour/ardour/export_status.h index 6c6396dc5f..95921629c7 100644 --- a/libs/ardour/ardour/export_status.h +++ b/libs/ardour/ardour/export_status.h @@ -39,17 +39,22 @@ class LIBARDOUR_API ExportStatus { /* Status info */ volatile bool stop; - volatile bool running; void abort (bool error_occurred = false); bool aborted () const { return _aborted; } bool errors () const { return _errors; } + bool running () const { return _running; } + + void set_running (bool r) { + assert (!_run_lock.trylock()); // must hold lock + _running = r; + } + Glib::Threads::Mutex& lock () { return _run_lock; } PBD::Signal0<void> Finished; void finish (); - bool finished () const { return _finished; } - void cleanup (); + void cleanup (); /* Progress info */ @@ -77,8 +82,9 @@ class LIBARDOUR_API ExportStatus { private: volatile bool _aborted; volatile bool _errors; - volatile bool _finished; + volatile bool _running; + Glib::Threads::Mutex _run_lock; }; } // namespace ARDOUR |