Skip to content

Commit 38d0e39

Browse files
author
jef
committedDec 8, 2009

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed
 

‎src/app/qgsidentifyresults.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ QgsIdentifyResults::QgsIdentifyResults( QgsMapCanvas *canvas, QWidget *parent, Q
124124
QgsIdentifyResults::~QgsIdentifyResults()
125125
{
126126
clearRubberbands();
127-
delete mActionPopup;
127+
if ( mActionPopup )
128+
delete mActionPopup;
128129
}
129130

130131
QTreeWidgetItem *QgsIdentifyResults::layerItem( QObject *layer )
@@ -290,6 +291,10 @@ void QgsIdentifyResults::show()
290291
// (saves the current window size/position)
291292
void QgsIdentifyResults::close()
292293
{
294+
clearRubberbands();
295+
delete mActionPopup;
296+
mActionPopup = 0;
297+
293298
saveWindowLocation();
294299
done( 0 );
295300
}
@@ -327,13 +332,13 @@ void QgsIdentifyResults::contextMenuEvent( QContextMenuEvent* event )
327332
if ( !item )
328333
return;
329334

330-
if ( mActionPopup )
331-
delete mActionPopup;
332-
333335
QgsVectorLayer *vlayer = vectorLayer( item );
334336
if ( vlayer == 0 )
335337
return;
336338

339+
if ( mActionPopup )
340+
delete mActionPopup;
341+
337342
mActionPopup = new QMenu();
338343

339344
mActionPopup->addAction( vlayer->isEditable() ? tr( "Edit feature form" ) : tr( "View feature form" ), this, SLOT( featureForm() ) );

0 commit comments

Comments
 (0)
Please sign in to comment.