mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-28 00:04:04 -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 )
|
||||
{
|
||||
if( mAction )
|
||||
disconnect( mAction, SIGNAL( destroyed() ), this, SLOT( actionDestroyed() ) );
|
||||
mAction = action;
|
||||
connect( mAction, SIGNAL( destroyed() ), this, SLOT( actionDestroyed() ) );
|
||||
}
|
||||
|
||||
void QgsMapTool::actionDestroyed()
|
||||
{
|
||||
if( mAction == sender() )
|
||||
mAction = 0;
|
||||
}
|
||||
|
||||
QAction* QgsMapTool::action()
|
||||
|
@ -153,6 +153,10 @@ class GUI_EXPORT QgsMapTool : public QObject
|
||||
//! emit signal to clear previous message
|
||||
void messageDiscarded();
|
||||
|
||||
private slots:
|
||||
//! clear pointer when action is destroyed
|
||||
void actionDestroyed();
|
||||
|
||||
protected:
|
||||
|
||||
//! constructor takes map canvas as a parameter
|
||||
|
Loading…
x
Reference in New Issue
Block a user