aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Mardelle <[email protected]>2015-09-19 13:19:00 +0200
committerJean-Baptiste Mardelle <[email protected]>2015-09-19 13:19:00 +0200
commite31867a8be482957180cd281762c6141ce4280b0 (patch)
tree4b01229c213264b30cac65b7dd9f4b93fe715d42
parent03f86dd36ccf9164caa400afebd8ab86dde23082 (diff)
Fix concurrency crash when layout has clip and project monitor side by side
-rw-r--r--src/monitor/monitormanager.cpp1
-rw-r--r--src/monitor/monitormanager.h2
2 files changed, 3 insertions, 0 deletions
diff --git a/src/monitor/monitormanager.cpp b/src/monitor/monitormanager.cpp
index 04ed1cf..08365da 100644
--- a/src/monitor/monitormanager.cpp
+++ b/src/monitor/monitormanager.cpp
@@ -101,6 +101,7 @@ void MonitorManager::setConsumerProperty(const QString &name, const QString &val
bool MonitorManager::activateMonitor(Kdenlive::MonitorId name, bool forceRefresh)
{
+ QMutexLocker locker(&m_refreshMutex);
if (m_clipMonitor == NULL || m_projectMonitor == NULL)
return false;
if (m_activeMonitor && m_activeMonitor->id() == name) {
diff --git a/src/monitor/monitormanager.h b/src/monitor/monitormanager.h
index d30dfeb..9f6f777 100644
--- a/src/monitor/monitormanager.h
+++ b/src/monitor/monitormanager.h
@@ -110,6 +110,8 @@ private slots:
void slotMuteCurrentMonitor(bool active);
private:
+ /** @brief Make sure 2 monitors cannot be activated simultaneously*/
+ QMutex m_refreshMutex;
/** @brief Sets up all the actions and attaches them to the collection of MainWindow. */
void setupActions();
KdenliveDoc *m_document;