]> git.sesse.net Git - kdenlive/blobdiff - src/kthumb.cpp
Rewrote thread handling, should improve ui responsiveness
[kdenlive] / src / kthumb.cpp
index 7bc4d6f82b419e53153f530f67ce5976bc1d7d70..2f326b1051b692f00134d193dc3a2a9a5fa811a1 100644 (file)
@@ -70,20 +70,19 @@ KThumb::~KThumb()
 
 void KThumb::setProducer(Mlt::Producer *producer)
 {
+    m_mutex.lock();
     m_requestedThumbs.clear();
     m_intraFramesQueue.clear();
     m_future.waitForFinished();
     m_intra.waitForFinished();
-    m_mutex.lock();
     m_producer = producer;
-    m_mutex.unlock();
     // FIXME: the profile() call leaks an object, but trying to free
     // it leads to a double-free in Profile::~Profile()
     if (producer) {
         m_dar = producer->profile()->dar();
         m_ratio = (double) producer->profile()->width() / producer->profile()->height();
     }
-        
+    m_mutex.unlock();
 }
 
 void KThumb::clearProducer()