Skip to content
Permalink
Browse files
Fix rare crash on map canvas deletion
  • Loading branch information
wonder-sk committed Mar 29, 2017
1 parent 1c202e7 commit 55d0ad75331546d09a98f65c55decca6bda1f46c
Showing with 8 additions and 6 deletions.
  1. +8 −6 src/gui/qgsmapcanvas.cpp
@@ -198,6 +198,14 @@ QgsMapCanvas::~QgsMapCanvas()
}
mLastNonZoomMapTool = nullptr;

// rendering job may still end up writing into canvas map item
// so kill it before deleting canvas items
if ( mJob )
{
whileBlocking( mJob )->cancel();
Q_ASSERT( !mJob );
}

// delete canvas items prior to deleting the canvas
// because they might try to update canvas when it's
// already being destructed, ends with segfault
@@ -215,12 +223,6 @@ QgsMapCanvas::~QgsMapCanvas()
// mCanvasProperties auto-deleted via QScopedPointer
// CanvasProperties struct has its own dtor for freeing resources

if ( mJob )
{
whileBlocking( mJob )->cancel();
delete mJob;
}

delete mCache;

delete mLabelingResults;

0 comments on commit 55d0ad7

Please sign in to comment.