Commit f5f4f135 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Solved dead lock when stopping in synchrone mode.

parent 373d7a68
......@@ -323,3 +323,11 @@ unsigned char* MainWorkflow::getSynchroneOutput()
return MainWorkflow::blackOutput;
return m_synchroneRenderingBuffer;
}
void MainWorkflow::cancelSynchronisation()
{
{
QMutexLocker lock( m_synchroneRenderWaitConditionMutex );
}
m_synchroneRenderWaitCondition->wakeAll();
}
......@@ -81,6 +81,12 @@ class MainWorkflow : public QObject, public Singleton<MainWorkflow>
static MainWorkflow* getInstance();
static void deleteInstance();
/**
* \brief This method will wake every wait condition, so that threads won't
* be waiting anymore, thus avoiding dead locks.
*/
void cancelSynchronisation();
private:
static MainWorkflow* m_instance;
// QAtomicInt m_oneFrameOnly;
......
......@@ -266,9 +266,13 @@ void WorkflowRenderer::togglePlayPause( bool forcePause )
void WorkflowRenderer::stop()
{
qDebug() << "Stopping workflow renderer";
m_isRendering = false;
m_paused = false;
qDebug() << "Stopping media player";
m_mainWorkflow->cancelSynchronisation();
m_mediaPlayer->stop();
qDebug() << "Stopping main workflow";
m_mainWorkflow->stop();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment