Skip to content
Permalink
Browse files
destructor fix, delete mCanvasEdit etc.
git-svn-id: http://svn.osgeo.org/qgis/trunk@5729 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek committed Aug 24, 2006
1 parent 6a3431a commit 744f78f6107045d5a50cc81baea9650a1c8d2494
Showing with 11 additions and 3 deletions.
  1. +8 −3 src/plugins/grass/qgsgrassedit.cpp
  2. +3 −0 src/plugins/grass/qgsgrassedit.h
@@ -107,7 +107,7 @@ bool QgsGrassEdit::mRunning = false;
QgsGrassEdit::QgsGrassEdit ( QgisApp *qgisApp, QgisIface *iface,
QWidget * parent, Qt::WFlags f )
:QMainWindow(parent,f), QgsGrassEditBase (), mMapTool(0),
mCanvasEdit(0), mRubberBandLine(0), mRubberBandIcon(0)
mCanvasEdit(0), mRubberBandLine(0), mRubberBandIcon(0), mInited(false)
{
#ifdef QGISDEBUG
std::cerr << "QgsGrassEdit()" << std::endl;
@@ -195,7 +195,7 @@ QgsGrassEdit::QgsGrassEdit ( QgisApp *qgisApp, QgisIface *iface,
QgsGrassProvider *provider,
QWidget * parent, Qt::WFlags f )
:QMainWindow(parent, 0, f), QgsGrassEditBase (), mMapTool(0),
mCanvasEdit(0), mRubberBandLine(0), mRubberBandIcon(0)
mCanvasEdit(0), mRubberBandLine(0), mRubberBandIcon(0), mInited(false)
{
#ifdef QGISDEBUG
std::cerr << "QgsGrassEdit()" << std::endl;
@@ -539,6 +539,7 @@ void QgsGrassEdit::init()
restorePosition();

mValid = true;
mInited = true;
}

void QgsGrassEdit::attributeTableFieldChanged ( void )
@@ -920,7 +921,10 @@ QgsGrassEdit::~QgsGrassEdit()
std::cerr << "QgsGrassEdit::~QgsGrassEdit()" << std::endl;
#endif

if (mValid) // we can only call some methods if init was complete
// we can only call some methods if init was complete,
// note that we cannot use mValid because it is disabled before
// destructor is called
if (mInited)
{
if ( mMapTool ) mCanvas->unsetMapTool ( mMapTool );
// TODO: delete tool? Probably
@@ -931,6 +935,7 @@ QgsGrassEdit::~QgsGrassEdit()
mRubberBandLine->reset();
delete mRubberBandLine;
delete mRubberBandIcon;

delete mCanvasEdit;

mCanvas->refresh();
@@ -294,6 +294,9 @@ public slots:

//! Status: true - active vector was successfully opened for editing
bool mValid;

//! Initialization complete
bool mInited;

//! QGIS application
QgisApp *mQgisApp;

0 comments on commit 744f78f

Please sign in to comment.