Skip to content
Permalink
Browse files
Followup 90f381, fix memory leaks when rendering canvas
  • Loading branch information
nyalldawson committed Apr 1, 2017
1 parent 22cf49d commit 9838a8fc7fb96ad30008bd25aa5aa58b922e4b6e
Showing with 13 additions and 1 deletion.
  1. +9 −1 src/core/qgsmaprendererparalleljob.cpp
  2. +4 −0 src/core/qgsmaprendererparalleljob.h
@@ -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() ) );
}
}

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

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

cleanupJobs( mLayerJobs );
renderingFinished();
}

@@ -74,6 +74,10 @@ class CORE_EXPORT QgsMapRendererParallelJob : public QgsMapRendererQImageJob
QgsRenderContext mLabelingRenderContext;
QFuture<void> mLabelingFuture;
QFutureWatcher<void> mLabelingFutureWatcher;

private slots:

void renderLayersFinishedWhenJobCanceled();
};


0 comments on commit 9838a8f

Please sign in to comment.