mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
Avoid crash from storage of potentially removed map layer storage in canvas
This commit is contained in:
parent
8075368638
commit
56b6ebd91c
@ -285,6 +285,9 @@ QgsMapLayer *QgsMapCanvas::layer( int index )
|
|||||||
|
|
||||||
void QgsMapCanvas::setCurrentLayer( QgsMapLayer *layer )
|
void QgsMapCanvas::setCurrentLayer( QgsMapLayer *layer )
|
||||||
{
|
{
|
||||||
|
if ( mCurrentLayer == layer )
|
||||||
|
return;
|
||||||
|
|
||||||
mCurrentLayer = layer;
|
mCurrentLayer = layer;
|
||||||
emit currentLayerChanged( layer );
|
emit currentLayerChanged( layer );
|
||||||
}
|
}
|
||||||
|
@ -928,7 +928,7 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
|
|||||||
bool mRenderFlag = true;
|
bool mRenderFlag = true;
|
||||||
|
|
||||||
//! current layer in legend
|
//! current layer in legend
|
||||||
QgsMapLayer *mCurrentLayer = nullptr;
|
QPointer< QgsMapLayer > mCurrentLayer;
|
||||||
|
|
||||||
//! graphics scene manages canvas items
|
//! graphics scene manages canvas items
|
||||||
QGraphicsScene *mScene = nullptr;
|
QGraphicsScene *mScene = nullptr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user