Skip to content
Permalink
Browse files

Fix crash on exit

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 c50cbfc98f11f8c388264f1a72b06a1494ffa7dd
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/app/qgssnappingwidget.cpp
@@ -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 );

0 comments on commit c50cbfc

Please sign in to comment.
You can’t perform that action at this time.