mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-04-15 05:32:21 +00:00
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:
@@ -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()
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user