]> git.sesse.net Git - kdenlive/blobdiff - src/trackview.cpp
Fix corruption when changing the project profile
[kdenlive] / src / trackview.cpp
index 7f886d6bf9de8c4aa5c796567cf19556fbf1c138..e790a4c1c0e3bf01690381651250980be004c682 100644 (file)
@@ -447,7 +447,7 @@ void TrackView::slotRebuildTrackHeaders()
     while ((child = m_view.headers_container->layout()->takeAt(0)) != 0) {
         QWidget *wid = child->widget();
         delete child;
-        if (wid) delete wid;
+        if (wid) wid->deleteLater();
     }
     int max = list.count();
     int height = KdenliveSettings::trackheight() * m_scene->scale().y() - 1;
@@ -789,8 +789,10 @@ DocClipBase *TrackView::getMissingProducer(const QString id) const
     // prepend MLT XML document root if no path in clip resource and not a color clip
     if (!resource.startsWith('/') && !resource.startsWith("0x")) resource.prepend(docRoot);
     DocClipBase *missingClip = NULL;
-    if (!resource.isEmpty())
-        missingClip = m_doc->clipManager()->getClipByResource(resource);
+    if (!resource.isEmpty()) {
+        QList <DocClipBase *> list = m_doc->clipManager()->getClipByResource(resource);
+        if (!list.isEmpty()) missingClip = list.at(0);
+    }
     return missingClip;
 }
 
@@ -845,6 +847,7 @@ void TrackView::slotVerticalZoomUp()
 void TrackView::updateProjectFps()
 {
     m_ruler->updateProjectFps(m_doc->timecode());
+    m_trackview->updateProjectFps();
 }
 
 void TrackView::slotRenameTrack(int ix)