void QgsMapRendererJob::cleanupJobs( LayerRenderJobs& jobs ) { for ( LayerRenderJobs::iterator it = jobs.begin(); it != jobs.end(); ++it ) { LayerRenderJob& job = *it; if ( job.img ) { delete job.context.painter(); job.context.setPainter( 0 ); if ( mCache && !job.cached && !job.context.renderingStopped() ) { QgsDebugMsg( "caching image for " + job.layerId ); mCache->setCacheImage( job.layerId, *job.img ); } delete job.img; job.img = 0; } if ( job.renderer ) { foreach ( QString message, job.renderer->errors() ) mErrors.append( Error( job.renderer->layerID(), message ) ); delete job.renderer; job.renderer = 0; } } jobs.clear(); updateLayerGeometryCaches(); }
void QgsMapRendererJob::cleanupJobs( LayerRenderJobs &jobs ) { for ( LayerRenderJobs::iterator it = jobs.begin(); it != jobs.end(); ++it ) { LayerRenderJob &job = *it; if ( job.img ) { delete job.context.painter(); job.context.setPainter( nullptr ); if ( mCache && !job.cached && !job.context.renderingStopped() && job.layer ) { QgsDebugMsg( "caching image for " + ( job.layer ? job.layer->id() : QString() ) ); mCache->setCacheImage( job.layer->id(), *job.img, QList< QgsMapLayer * >() << job.layer ); } delete job.img; job.img = nullptr; } if ( job.renderer ) { Q_FOREACH ( const QString &message, job.renderer->errors() ) mErrors.append( Error( job.renderer->layerId(), message ) ); delete job.renderer; job.renderer = nullptr; } if ( job.layer ) mPerLayerRenderingTime.insert( job.layer, job.renderingTime ); }