Skip to content

Commit

Permalink
Followup 90f381, fix memory leaks when rendering canvas
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Apr 1, 2017
1 parent 22cf49d commit 9838a8f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/core/qgsmaprendererparalleljob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ void QgsMapRendererParallelJob::cancelWithoutBlocking()
if ( mStatus == RenderingLayers )
{
disconnect( &mFutureWatcher, SIGNAL( finished() ), this, SLOT( renderLayersFinished() ) );
connect( &mFutureWatcher, SIGNAL( finished() ), this, SLOT( renderingFinished() ) );
connect( &mFutureWatcher, SIGNAL( finished() ), this, SLOT( renderLayersFinishedWhenJobCanceled() ) );
}
}

Expand Down Expand Up @@ -306,3 +306,11 @@ void QgsMapRendererParallelJob::renderLabelsStatic( QgsMapRendererParallelJob* s
painter.end();
}

void QgsMapRendererParallelJob::renderLayersFinishedWhenJobCanceled()
{
logRenderingTime( mLayerJobs );

cleanupJobs( mLayerJobs );
renderingFinished();
}

4 changes: 4 additions & 0 deletions src/core/qgsmaprendererparalleljob.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ class CORE_EXPORT QgsMapRendererParallelJob : public QgsMapRendererQImageJob
QgsRenderContext mLabelingRenderContext;
QFuture<void> mLabelingFuture;
QFutureWatcher<void> mLabelingFutureWatcher;

private slots:

void renderLayersFinishedWhenJobCanceled();
};


Expand Down

0 comments on commit 9838a8f

Please sign in to comment.