Skip to content
Browse files

Fix crash on exit

Because the map canvas is destroyed before the project instance,
and QgsProject emits the labelingEngineSettingsChange signal
during its destructor, the lambda slot was getting executed
with a dangling map canvas pointer.

Correctly set the receiver in the lambda connection instead
so that the connection gets destroyed along with the canvas.

(cherry-picked from b683291)
  • Loading branch information
nyalldawson committed May 3, 2018
1 parent e744455 commit 14f0a832ec5036b271e9ed03de5de36f70a32f0f
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/app/qgisapp.cpp
@@ -3184,7 +3184,7 @@ void QgisApp::setupConnections()
} );

connect( QgsProject::instance(), &QgsProject::labelingEngineSettingsChanged,
this, [ = ]
mMapCanvas, [ = ]
mMapCanvas->setLabelingEngineSettings( QgsProject::instance()->labelingEngineSettings() );
} );

0 comments on commit 14f0a83

Please sign in to comment.
You can’t perform that action at this time.