Killing of running process in destructor.
authorMikko Keinänen <mikko.keinanen@gmail.com>
Tue, 19 Oct 2010 21:37:28 +0000 (00:37 +0300)
committerMikko Keinänen <mikko.keinanen@gmail.com>
Tue, 19 Oct 2010 21:37:28 +0000 (00:37 +0300)
src/emulauncher.cpp

index a71b046..ddc77b9 100644 (file)
@@ -49,8 +49,10 @@ EmuLauncher::~EmuLauncher()
 {
     if (emuHelper) {
         qDebug() << "EmuLauncher destructor";
-        emuHelper->kill(); // TODO: do this in a more sophisticated way
-    }
+        if (emuHelper->state() == EmuHelper::Running)
+            qDebug() << "EmuHelper process is running, killing...";
+            emuHelper->kill();
+        }
 }
 
 void EmuLauncher::updateData()