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.
This commit is contained in:
Nyall Dawson 2018-05-01 20:10:04 +10:00
parent 46f867cef4
commit b6832916d7

View File

@ -3253,7 +3253,7 @@ void QgisApp::setupConnections()
} );
connect( QgsProject::instance(), &QgsProject::labelingEngineSettingsChanged,
this, [ = ]
mMapCanvas, [ = ]
{
mMapCanvas->setLabelingEngineSettings( QgsProject::instance()->labelingEngineSettings() );
} );