Skip to content
Permalink
Browse files
fixed ticket 187 (crash if user is not owner of the vector)
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5685 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek committed Aug 10, 2006
1 parent eec7b18 commit c4ebc229224f6fe6d6c81efa82e67151ca82c967
Showing with 11 additions and 10 deletions.
  1. +11 −10 src/plugins/grass/qgsgrassedit.cpp
@@ -106,7 +106,8 @@ bool QgsGrassEdit::mRunning = false;

QgsGrassEdit::QgsGrassEdit ( QgisApp *qgisApp, QgisIface *iface,
QWidget * parent, Qt::WFlags f )
:QMainWindow(parent,f), QgsGrassEditBase (), mMapTool(0)
:QMainWindow(parent,f), QgsGrassEditBase (), mMapTool(0),
mCanvasEdit(0), mRubberBandLine(0), mRubberBandIcon(0)
{
#ifdef QGISDEBUG
std::cerr << "QgsGrassEdit()" << std::endl;
@@ -193,7 +194,8 @@ void QgsGrassEdit::keyPress(QKeyEvent *e)
QgsGrassEdit::QgsGrassEdit ( QgisApp *qgisApp, QgisIface *iface,
QgsGrassProvider *provider,
QWidget * parent, Qt::WFlags f )
:QMainWindow(parent, 0, f), QgsGrassEditBase (), mMapTool(0)
:QMainWindow(parent, 0, f), QgsGrassEditBase (), mMapTool(0),
mCanvasEdit(0), mRubberBandLine(0), mRubberBandIcon(0)
{
#ifdef QGISDEBUG
std::cerr << "QgsGrassEdit()" << std::endl;
@@ -918,8 +920,11 @@ QgsGrassEdit::~QgsGrassEdit()
std::cerr << "QgsGrassEdit::~QgsGrassEdit()" << std::endl;
#endif

if (mCanvasEdit) {

if (mValid) // we can only call some methods if init was complete
{
if ( mMapTool ) mCanvas->unsetMapTool ( mMapTool );
// TODO: delete tool? Probably

eraseDynamic();
mRubberBandLine->hide();
mRubberBandIcon->hide();
@@ -928,15 +933,11 @@ QgsGrassEdit::~QgsGrassEdit()
delete mRubberBandIcon;
delete mCanvasEdit;

if ( mMapTool ) mCanvas->unsetMapTool ( mMapTool );
// TODO: delete tool? Probably

mCanvas->refresh();

saveWindowLocation();
}

saveWindowLocation();
mRunning = false;

}

bool QgsGrassEdit::isRunning(void)

0 comments on commit c4ebc22

Please sign in to comment.