Fix memory leak in Video Window on Mac (QTKit)

Need to call QTMovie::deallocate before setMovie to
ensure it is free'd by the QTMoveView.
This commit is contained in:
Mark Liversedge
2011-11-01 08:47:39 +00:00
parent 0f60badc82
commit 2c8a5347b4

View File

@@ -97,9 +97,12 @@ static inline NSString *darwinQStringToNSString (const QString &aString)
void VideoWindow::mediaSelected(QString filename)
{
// stop any current playback
stopPlayback();
hasMovie = false;
movie = NULL;
if (hasMovie) {
stopPlayback();
[movie invalidate]; // let the view deallocate
hasMovie = false;
movie = NULL;
}
// open the movie file
if (filename != "" && QFile(filename).exists()) {