From d0a4ba6b19def9ec3471fa17956d952e37f9ae94 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sun, 31 Mar 2019 10:47:13 +1100 Subject: [PATCH] fixed #734 --- rendering/exportthread.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rendering/exportthread.cpp b/rendering/exportthread.cpp index abb8e837e..5cb1afe5c 100644 --- a/rendering/exportthread.cpp +++ b/rendering/exportthread.cpp @@ -414,9 +414,6 @@ void ExportThread::Export() disconnect(renderer, SIGNAL(ready()), panel_sequence_viewer->viewer_widget, SLOT(queue_repaint())); connect(renderer, SIGNAL(ready()), this, SLOT(wake())); - // Lock mutex (used for synchronization with RenderThread) - mutex.lock(); - // Loop from now (set to the beginning frame earlier) to the end of the frame while (olive::ActiveSequence->playhead <= params_.end_frame && !interrupt_) { @@ -557,8 +554,6 @@ void ExportThread::Export() disconnect(renderer, SIGNAL(ready()), this, SLOT(wake())); connect(renderer, SIGNAL(ready()), panel_sequence_viewer->viewer_widget, SLOT(queue_repaint())); - mutex.unlock(); - if (interrupt_) { return; } @@ -667,9 +662,14 @@ void ExportThread::run() { // Seek to the first frame we're exporting panel_sequence_viewer->seek(params_.start_frame); + // Lock mutex (used for thread synchronizations) + mutex.lock(); + // Run export function (which will return if there's a failure) Export(); + mutex.unlock(); + // Clean up anything that was allocated in Export() (whether it succeeded or not) Cleanup(); }