Skip to content

Commit 0a628ff

Browse files
committed
Fix crash on layer save/rollback
Context objects should always be used in lamda connects, or the connection has a potentially infinite lifetime!
1 parent 2069dc7 commit 0a628ff

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/app/qgsattributetabledialog.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,14 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *layer, QgsAttr
114114
connect( mMainView, &QgsDualView::showContextMenuExternally, this, &QgsAttributeTableDialog::showContextMenu );
115115

116116
// Block/unblock table updates (feature cache signals)
117-
connect( QgisApp::instance(), &QgisApp::attributeTableUpdateBlocked, [ = ]( const QgsVectorLayer * layer, const bool blocked )
117+
connect( QgisApp::instance(), &QgisApp::attributeTableUpdateBlocked, this, [ = ]( const QgsVectorLayer * layer, const bool blocked )
118118
{
119119
if ( layer == mLayer )
120120
this->blockCacheUpdateSignals( blocked );
121121
} );
122122
// Massive rollbacks can also freeze the GUI due to the feature cache signals
123-
connect( mLayer, &QgsVectorLayer::beforeRollBack, [ = ] { this->blockCacheUpdateSignals( true ); } );
124-
connect( mLayer, &QgsVectorLayer::afterRollBack, [ = ] { this->blockCacheUpdateSignals( false ); } );
123+
connect( mLayer, &QgsVectorLayer::beforeRollBack, this, [ = ] { this->blockCacheUpdateSignals( true ); } );
124+
connect( mLayer, &QgsVectorLayer::afterRollBack, this, [ = ] { this->blockCacheUpdateSignals( false ); } );
125125

126126
const QgsFields fields = mLayer->fields();
127127
for ( const QgsField &field : fields )

0 commit comments

Comments
 (0)