From 29eddfb5eca505485672ca9c759ed9c7b8399cd2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mikko=20Kein=C3=A4nen?= Date: Wed, 20 Oct 2010 00:37:28 +0300 Subject: [PATCH] Killing of running process in destructor. --- src/emulauncher.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/emulauncher.cpp b/src/emulauncher.cpp index a71b046..ddc77b9 100644 --- a/src/emulauncher.cpp +++ b/src/emulauncher.cpp @@ -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() -- 1.7.9.5