Skip to content
Permalink
Browse files

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

…canvas
  • Loading branch information
nyalldawson committed Aug 17, 2018
1 parent 8075368 commit 56b6ebd91ce5067df4c87093e84908cd4dba9f49
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 );
}
@@ -928,7 +928,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 56b6ebd

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