Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 14f0a83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/qgisapp.cpp
Expand Up @@ -3184,7 +3184,7 @@ void QgisApp::setupConnections()
} );

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

0 comments on commit 14f0a83

Please sign in to comment.