]> git.sesse.net Git - kdenlive/commitdiff
fix memleak & only fetch thumbnails if user wants them
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Tue, 17 Jun 2008 21:17:52 +0000 (21:17 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Tue, 17 Jun 2008 21:17:52 +0000 (21:17 +0000)
svn path=/branches/KDE4/; revision=2253

src/clipitem.cpp
src/kthumb.cpp
src/renderer.cpp

index 138414d561d64d871650af279fd229b2967a66a3..96e489cdce805624bd14b8662ce40ed4f4907af4 100644 (file)
@@ -692,12 +692,12 @@ void ClipItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *) {
 
 void ClipItem::resizeStart(int posx, double scale) {
     AbstractClipItem::resizeStart(posx, scale);
-    if (m_hasThumbs) startThumbTimer->start(100);
+    if (m_hasThumbs && KdenliveSettings::videothumbnails()) startThumbTimer->start(100);
 }
 
 void ClipItem::resizeEnd(int posx, double scale) {
     AbstractClipItem::resizeEnd(posx, scale);
-    if (m_hasThumbs) endThumbTimer->start(100);
+    if (m_hasThumbs && KdenliveSettings::videothumbnails()) endThumbTimer->start(100);
 }
 
 // virtual
index a1bd47adb282390286dee2a2d32568fae5e4cdf8..948affe7aad8cb3a3bbffd601f094ee060d42caa 100644 (file)
@@ -240,6 +240,7 @@ QPixmap KThumb::getFrame(Mlt::Producer* producer, int framepos, int width, int h
         QImage scale = image.scaled(width, height, Qt::KeepAspectRatio, Qt::SmoothTransformation).rgbSwapped();
         pix = pix.fromImage(scale);
     } else pix.fill(Qt::black);
+       mlt_pool_release(new_image);
     if (frame) delete frame;
     return pix;
 }
index 75750708c1a6c5cab06b568c6b6c82c0ba3528ce..cf88bf4f802a01177a9ef3fe2267d777d6652845 100644 (file)
@@ -442,7 +442,7 @@ void Render::getFileProperties(const QDomElement &xml, int clipId) {
                 QImage scale = image.scaled(width, height, Qt::KeepAspectRatio, Qt::SmoothTransformation).rgbSwapped();
                 pix = pix.fromImage(scale);
             } else pix.fill(Qt::black);
-
+                       mlt_pool_release(new_image);
             emit replyGetImage(clipId, 0, pix, width, height);
 
         } else if (frame->get_int("test_audio") == 0) {