Skip to content

Commit c50cbfc

Browse files
committedJan 23, 2018
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.
1 parent 7ef9355 commit c50cbfc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎src/app/qgssnappingwidget.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ QgsSnappingWidget::QgsSnappingWidget( QgsProject *project, QgsMapCanvas *canvas,
7878
{
7979
model->resetLayerTreeModel();
8080
} );
81+
connect( mProject, &QObject::destroyed, this, [ = ]
82+
{
83+
mLayerTreeView->setModel( nullptr );
84+
} );
8185
// model->setFlags( 0 );
8286
mLayerTreeView->setModel( model );
8387
mLayerTreeView->resizeColumnToContents( 0 );

0 commit comments

Comments
 (0)
Please sign in to comment.