mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-16 00:03:12 -04:00
Fix crash on layer save/rollback
Context objects should always be used in lamda connects, or the connection has a potentially infinite lifetime!
This commit is contained in:
parent
2069dc7a97
commit
0a628ff649
@ -114,14 +114,14 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *layer, QgsAttr
|
|||||||
connect( mMainView, &QgsDualView::showContextMenuExternally, this, &QgsAttributeTableDialog::showContextMenu );
|
connect( mMainView, &QgsDualView::showContextMenuExternally, this, &QgsAttributeTableDialog::showContextMenu );
|
||||||
|
|
||||||
// Block/unblock table updates (feature cache signals)
|
// Block/unblock table updates (feature cache signals)
|
||||||
connect( QgisApp::instance(), &QgisApp::attributeTableUpdateBlocked, [ = ]( const QgsVectorLayer * layer, const bool blocked )
|
connect( QgisApp::instance(), &QgisApp::attributeTableUpdateBlocked, this, [ = ]( const QgsVectorLayer * layer, const bool blocked )
|
||||||
{
|
{
|
||||||
if ( layer == mLayer )
|
if ( layer == mLayer )
|
||||||
this->blockCacheUpdateSignals( blocked );
|
this->blockCacheUpdateSignals( blocked );
|
||||||
} );
|
} );
|
||||||
// Massive rollbacks can also freeze the GUI due to the feature cache signals
|
// Massive rollbacks can also freeze the GUI due to the feature cache signals
|
||||||
connect( mLayer, &QgsVectorLayer::beforeRollBack, [ = ] { this->blockCacheUpdateSignals( true ); } );
|
connect( mLayer, &QgsVectorLayer::beforeRollBack, this, [ = ] { this->blockCacheUpdateSignals( true ); } );
|
||||||
connect( mLayer, &QgsVectorLayer::afterRollBack, [ = ] { this->blockCacheUpdateSignals( false ); } );
|
connect( mLayer, &QgsVectorLayer::afterRollBack, this, [ = ] { this->blockCacheUpdateSignals( false ); } );
|
||||||
|
|
||||||
const QgsFields fields = mLayer->fields();
|
const QgsFields fields = mLayer->fields();
|
||||||
for ( const QgsField &field : fields )
|
for ( const QgsField &field : fields )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user