File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -198,6 +198,14 @@ QgsMapCanvas::~QgsMapCanvas()
198
198
}
199
199
mLastNonZoomMapTool = nullptr ;
200
200
201
+ // rendering job may still end up writing into canvas map item
202
+ // so kill it before deleting canvas items
203
+ if ( mJob )
204
+ {
205
+ whileBlocking ( mJob )->cancel ();
206
+ Q_ASSERT ( !mJob );
207
+ }
208
+
201
209
// delete canvas items prior to deleting the canvas
202
210
// because they might try to update canvas when it's
203
211
// already being destructed, ends with segfault
@@ -215,12 +223,6 @@ QgsMapCanvas::~QgsMapCanvas()
215
223
// mCanvasProperties auto-deleted via QScopedPointer
216
224
// CanvasProperties struct has its own dtor for freeing resources
217
225
218
- if ( mJob )
219
- {
220
- whileBlocking ( mJob )->cancel ();
221
- delete mJob ;
222
- }
223
-
224
226
delete mCache ;
225
227
226
228
delete mLabelingResults ;
You can’t perform that action at this time.
0 commit comments