Skip to content

Commit e204157

Browse files
author
rblazek
committed
close tools when mapset changed
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5197 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 47ce15f commit e204157

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

src/plugins/grass/qgsgrassmodule.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -1264,6 +1264,10 @@ QgsGrassModule::~QgsGrassModule()
12641264
#ifdef QGISDEBUG
12651265
std::cerr << "QgsGrassModule::~QgsGrassModule()" << std::endl;
12661266
#endif
1267+
if ( mProcess.state() == QProcess::Running )
1268+
{
1269+
mProcess.kill();
1270+
}
12671271
}
12681272

12691273
QDomNode QgsGrassModule::nodeByKey ( QDomElement elem, QString key )

src/plugins/grass/qgsgrassplugin.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ QgsGrassPlugin::QgsGrassPlugin(QgisApp * theQGisApp, QgisIface * theQgisInterFac
9696

9797
QgsGrassPlugin::~QgsGrassPlugin()
9898
{
99+
if ( mTools ) mTools->closeTools();
99100
QString err = QgsGrass::closeMapset();
100101
}
101102

@@ -238,6 +239,8 @@ void QgsGrassPlugin::initGui()
238239

239240
void QgsGrassPlugin::mapsetChanged ()
240241
{
242+
if ( mTools ) mTools->closeTools();
243+
241244
if ( !QgsGrass::activeMode() ) {
242245
mOpenToolsAction->setEnabled(false);
243246
mRegionAction->setEnabled(false);

src/plugins/grass/qgsgrasstools.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -454,5 +454,6 @@ void QgsGrassTools::closeTools()
454454
for ( int i = mTabWidget->count()-1; i > 1; i-- )
455455
{
456456
delete mTabWidget->widget(i);
457+
mTabWidget->removeTab(i);
457458
}
458459
}

0 commit comments

Comments
 (0)