Skip to content
Permalink
Browse files

Avoid crash from storage of potentially removed map layer storage in …

…canvas

(cherry-picked from 56b6ebd)
  • Loading branch information
nyalldawson committed Aug 17, 2018
1 parent 6fd5b23 commit cddbf9629035621cad02f78e4b711691778b7c04
Showing with 4 additions and 1 deletion.
  1. +3 −0 src/gui/qgsmapcanvas.cpp
  2. +1 −1 src/gui/qgsmapcanvas.h
@@ -285,6 +285,9 @@ QgsMapLayer *QgsMapCanvas::layer( int index )

void QgsMapCanvas::setCurrentLayer( QgsMapLayer *layer )
{
if ( mCurrentLayer == layer )
return;

mCurrentLayer = layer;
emit currentLayerChanged( layer );
}
@@ -917,7 +917,7 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
bool mRenderFlag = true;

//! current layer in legend
QgsMapLayer *mCurrentLayer = nullptr;
QPointer< QgsMapLayer > mCurrentLayer;

//! graphics scene manages canvas items
QGraphicsScene *mScene = nullptr;

0 comments on commit cddbf96

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