Skip to content

Commit

Permalink
Fix crash on exit
Browse files Browse the repository at this point in the history
Since the snapping widget is destroyed *after* the project instance,
we need to avoid referring to the project after it's deleted.
  • Loading branch information
nyalldawson committed Jan 23, 2018
1 parent 7ef9355 commit c50cbfc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/app/qgssnappingwidget.cpp
Expand Up @@ -78,6 +78,10 @@ QgsSnappingWidget::QgsSnappingWidget( QgsProject *project, QgsMapCanvas *canvas,
{
model->resetLayerTreeModel();
} );
connect( mProject, &QObject::destroyed, this, [ = ]
{
mLayerTreeView->setModel( nullptr );
} );
// model->setFlags( 0 );
mLayerTreeView->setModel( model );
mLayerTreeView->resizeColumnToContents( 0 );
Expand Down

0 comments on commit c50cbfc

Please sign in to comment.