Skip to content
Permalink
Browse files

fix crash when maptool of a plugin is active on exit

  • Loading branch information
jef-n committed Apr 25, 2014
1 parent 7f7118c commit b548ac8c5c3dcdb7999ddfaa5af3b9e5039ac2ce
Showing with 13 additions and 0 deletions.
  1. +9 −0 src/gui/qgsmaptool.cpp
  2. +4 −0 src/gui/qgsmaptool.h
@@ -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

0 comments on commit b548ac8

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