Fix memory leak in Video Window on Mac (QTKit)

Need to call QTMovie::invalidate before QTMovieView::setMovie to
ensure the mmap is deleted before allocating for the new one. This
fixes mmap errors when scrolling up and down a list of videos.
This commit is contained in:
Mark Liversedge
2011-11-01 08:47:39 +00:00
parent 4c3266d5dd
commit 6ed5437ddb
2 changed files with 14 additions and 8 deletions

View File

@@ -46,6 +46,8 @@ DialWindow::DialWindow(MainWindow *mainWindow) :
// display label...
QVBoxLayout *layout = new QVBoxLayout(this);
layout->setSpacing(0);
layout->setContentsMargins(3,3,3,3);
valueLabel = new QLabel(this);
valueLabel->setAlignment(Qt::AlignCenter | Qt::AlignVCenter);
layout->addWidget(valueLabel);
@@ -126,13 +128,15 @@ DialWindow::telemetryUpdate(const RealtimeData &rtData)
void DialWindow::resizeEvent(QResizeEvent * )
{
// set point size
int size = geometry().height()-15;
if (size <= 0) size = 4;
if (size >= 64) size = 64;
if (geometry().height()-37 < 0) return;
QFont font;
font.setPointSize((geometry().height()-37));
font.setWeight(QFont::Bold);
valueLabel->setFont(font);
QFont font;
font.setPointSize(size);
font.setWeight(QFont::Bold);
valueLabel->setFont(font);
}
void DialWindow::seriesChanged()

View File

@@ -260,8 +260,10 @@ int GcWindowLayout::doLayout(const QRect &rect, bool testOnly) const
}
// if not in test mode, set updates enabled before we repaint
if (!testOnly) parent->setUpdatesEnabled(true);
parent->repaint();
if (!testOnly) {
parent->repaint();
parent->setUpdatesEnabled(true);
}
// Return the length of the layout
int maxy=0;