Skip to content

Commit

Permalink
QgsLayoutAtlasWidget: Disconnect signals when layout RIP
Browse files Browse the repository at this point in the history
Fixes #29821
  • Loading branch information
elpaso committed May 27, 2019
1 parent 26f8815 commit 254569d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/app/layout/qgslayoutatlaswidget.cpp
Expand Up @@ -65,6 +65,14 @@ QgsLayoutAtlasWidget::QgsLayoutAtlasWidget( QWidget *parent, QgsPrintLayout *lay
}
connect( mAtlasFileFormat, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, [ = ]( int ) { changeFileFormat(); } );

// Disconnect when layout is destroyed
connect( layout, &QgsPrintLayout::destroyed, [ = ]
{
disconnect( mAtlasCoverageLayerComboBox, &QgsMapLayerComboBox::layerChanged, mAtlasSortExpressionWidget, &QgsFieldExpressionWidget::setLayer );
disconnect( mAtlasCoverageLayerComboBox, &QgsMapLayerComboBox::layerChanged, mPageNameWidget, &QgsFieldExpressionWidget::setLayer );
disconnect( mAtlasCoverageLayerComboBox, &QgsMapLayerComboBox::layerChanged, this, &QgsLayoutAtlasWidget::changeCoverageLayer );
} );

updateGuiElements();
}

Expand Down

0 comments on commit 254569d

Please sign in to comment.