Skip to content

Commit

Permalink
Fix some missing context arguments in connects with lambda
Browse files Browse the repository at this point in the history
These cause infinite lifetime connections which result in crashes

(cherry picked from commit 3d5badf)
  • Loading branch information
nyalldawson committed Nov 6, 2018
1 parent 647de81 commit 85aaf7e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/app/decorations/qgsdecorationnortharrowdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ QgsDecorationNorthArrowDialog::QgsDecorationNorthArrowDialog( QgsDecorationNorth
spinAngle->setEnabled( !mDeco.mAutomatic );
sliderRotation->setEnabled( !mDeco.mAutomatic );

connect( cboxAutomatic, &QAbstractButton::toggled, [ = ]( bool checked )
connect( cboxAutomatic, &QAbstractButton::toggled, this, [ = ]( bool checked )
{
spinAngle->setEnabled( !checked );
sliderRotation->setEnabled( !checked );
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsoptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
connect( mCustomVariablesChkBx, &QCheckBox::toggled, this, &QgsOptions::mCustomVariablesChkBx_toggled );
connect( mCurrentVariablesQGISChxBx, &QCheckBox::toggled, this, &QgsOptions::mCurrentVariablesQGISChxBx_toggled );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsOptions::showHelp );
connect( cboGlobalLocale, qgis::overload< int >::of( &QComboBox::currentIndexChanged ), [ = ]( int ) { updateSampleLocaleText( ); } );
connect( cboGlobalLocale, qgis::overload< int >::of( &QComboBox::currentIndexChanged ), this, [ = ]( int ) { updateSampleLocaleText( ); } );
connect( cbShowGroupSeparator, &QCheckBox::toggled, this, [ = ]( bool ) { updateSampleLocaleText(); } );

// QgsOptionsDialogBase handles saving/restoring of geometry, splitter and current tab states,
Expand Down
2 changes: 1 addition & 1 deletion src/gui/processing/qgsprocessingconfigurationwidgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ QgsFilterAlgorithmConfigurationWidget::QgsFilterAlgorithmConfigurationWidget( QW
connect( addOutputButton, &QToolButton::clicked, this, &QgsFilterAlgorithmConfigurationWidget::addOutput );
connect( removeOutputButton, &QToolButton::clicked, this, &QgsFilterAlgorithmConfigurationWidget::removeSelectedOutputs );

connect( mOutputExpressionWidget->selectionModel(), &QItemSelectionModel::selectionChanged, [removeOutputButton, this]
connect( mOutputExpressionWidget->selectionModel(), &QItemSelectionModel::selectionChanged, this, [removeOutputButton, this]
{
removeOutputButton->setEnabled( !mOutputExpressionWidget->selectionModel()->selectedIndexes().isEmpty() );
} );
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/georeferencer/qgsgeorefplugingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ void QgsGeorefPluginGui::showCoordDialog( const QgsPointXY &pixelCoords )
if ( mLayer && !mMapCoordsDialog )
{
mMapCoordsDialog = new QgsMapCoordsDialog( mIface->mapCanvas(), pixelCoords, this );
connect( mMapCoordsDialog, &QgsMapCoordsDialog::pointAdded,
connect( mMapCoordsDialog, &QgsMapCoordsDialog::pointAdded, this,
[this]( const QgsPointXY & a, const QgsPointXY & b ) { this->addPoint( a, b ); }
);
mMapCoordsDialog->show();
Expand Down

0 comments on commit 85aaf7e

Please sign in to comment.