Skip to content

Commit

Permalink
Fix crash on exit
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nyalldawson committed May 1, 2018
1 parent 46f867c commit b683291
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3253,7 +3253,7 @@ void QgisApp::setupConnections()
} );

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

0 comments on commit b683291

Please sign in to comment.