mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-11 00:04:27 -04:00
fix crash when maptool of a plugin is active on exit
This commit is contained in:
parent
7f7118ccfb
commit
b548ac8c5c
@ -98,7 +98,16 @@ void QgsMapTool::deactivate()
|
|||||||
|
|
||||||
void QgsMapTool::setAction( QAction* action )
|
void QgsMapTool::setAction( QAction* action )
|
||||||
{
|
{
|
||||||
|
if( mAction )
|
||||||
|
disconnect( mAction, SIGNAL( destroyed() ), this, SLOT( actionDestroyed() ) );
|
||||||
mAction = action;
|
mAction = action;
|
||||||
|
connect( mAction, SIGNAL( destroyed() ), this, SLOT( actionDestroyed() ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
void QgsMapTool::actionDestroyed()
|
||||||
|
{
|
||||||
|
if( mAction == sender() )
|
||||||
|
mAction = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
QAction* QgsMapTool::action()
|
QAction* QgsMapTool::action()
|
||||||
|
@ -153,6 +153,10 @@ class GUI_EXPORT QgsMapTool : public QObject
|
|||||||
//! emit signal to clear previous message
|
//! emit signal to clear previous message
|
||||||
void messageDiscarded();
|
void messageDiscarded();
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
//! clear pointer when action is destroyed
|
||||||
|
void actionDestroyed();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
//! constructor takes map canvas as a parameter
|
//! constructor takes map canvas as a parameter
|
||||||
|
Loading…
x
Reference in New Issue
Block a user