Skip to content

Commit ea9c9ff

Browse files
author
timlinux
committedNov 6, 2009
Greetings from Anita and Tim at the QGIS Hackfest in Vienna (Nov 2009). We have just fixed bug #2011 (Crash using Identify Feature)...Wheeeeee
git-svn-id: http://svn.osgeo.org/qgis/trunk@11927 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent b397e17 commit ea9c9ff

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed
 

‎src/app/qgsmaptoolidentify.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ void QgsMapToolIdentify::canvasReleaseEvent( QMouseEvent * e )
7272
return;
7373
}
7474

75+
if ( !mResults )
76+
{
77+
mResults = new QgsIdentifyResults( mCanvas, mCanvas->window() );
78+
}
7579
mResults->clear();
7680

7781
QSettings settings;
@@ -147,6 +151,10 @@ void QgsMapToolIdentify::canvasReleaseEvent( QMouseEvent * e )
147151

148152
void QgsMapToolIdentify::activate()
149153
{
154+
if ( !mResults )
155+
{
156+
mResults = new QgsIdentifyResults( mCanvas, mCanvas->window() );
157+
}
150158
mResults->activate();
151159
QgsMapTool::activate();
152160
}

‎src/app/qgsmaptoolidentify.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "qgsdistancearea.h"
2525

2626
#include <QObject>
27+
#include <QPointer>
2728

2829
class QgsIdentifyResults;
2930
class QgsMapLayer;
@@ -71,7 +72,7 @@ class QgsMapToolIdentify : public QgsMapTool
7172
bool identifyVectorLayer( QgsVectorLayer *layer, int x, int y );
7273

7374
//! Pointer to the identify results dialog for name/value pairs
74-
QgsIdentifyResults *mResults;
75+
QPointer<QgsIdentifyResults> mResults;
7576

7677
//! Private helper
7778
void convertMeasurement( QgsDistanceArea &calc, double &measure, QGis::UnitType &u, bool isArea );

0 commit comments

Comments
 (0)
Please sign in to comment.