Skip to content

Commit

Permalink
fixed ticket 187 (crash if user is not owner of the vector)
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@5685 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek committed Aug 10, 2006
1 parent 5fb61d3 commit d24fadd
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/plugins/grass/qgsgrassedit.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand All @@ -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)
Expand Down

0 comments on commit d24fadd

Please sign in to comment.