Skip to content
Snippets Groups Projects
Commit 15e04423 authored by Fawzi Mohamed's avatar Fawzi Mohamed
Browse files

ios: kill simulator process when stopping runner


Change-Id: I998eb9cd3d532c2818c139688d516003d4833b27
Reviewed-by: default avatarDavid Schulz <david.schulz@digia.com>
Reviewed-by: default avatarFawzi Mohamed <fawzi.mohamed@digia.com>
parent ddee9bdf
No related branches found
No related tags found
No related merge requests found
...@@ -43,6 +43,8 @@ ...@@ -43,6 +43,8 @@
#include <QTime> #include <QTime>
#include <QMessageBox> #include <QMessageBox>
#include <signal.h>
namespace Ios { namespace Ios {
namespace Internal { namespace Internal {
...@@ -50,7 +52,7 @@ IosRunner::IosRunner(QObject *parent, IosRunConfiguration *runConfig, bool debug ...@@ -50,7 +52,7 @@ IosRunner::IosRunner(QObject *parent, IosRunConfiguration *runConfig, bool debug
: QObject(parent), m_toolHandler(0), m_bundleDir(runConfig->bundleDir().toString()), : QObject(parent), m_toolHandler(0), m_bundleDir(runConfig->bundleDir().toString()),
m_arguments(runConfig->commandLineArguments()), m_arguments(runConfig->commandLineArguments()),
m_device(ProjectExplorer::DeviceKitInformation::device(runConfig->target()->kit())), m_device(ProjectExplorer::DeviceKitInformation::device(runConfig->target()->kit())),
m_debuggingMode(debuggingMode), m_cleanExit(false) m_debuggingMode(debuggingMode), m_cleanExit(false), m_pid(0)
{ {
} }
...@@ -121,8 +123,13 @@ void IosRunner::start() ...@@ -121,8 +123,13 @@ void IosRunner::start()
void IosRunner::stop() void IosRunner::stop()
{ {
if (m_toolHandler) if (m_toolHandler) {
#ifdef Q_OS_UNIX
if (m_pid > 0)
kill(m_pid, SIGKILL);
#endif
m_toolHandler->stop(); m_toolHandler->stop();
}
} }
void IosRunner::handleDidStartApp(IosToolHandler *handler, const QString &bundlePath, void IosRunner::handleDidStartApp(IosToolHandler *handler, const QString &bundlePath,
...@@ -145,6 +152,7 @@ void IosRunner::handleGotInferiorPid(IosToolHandler *handler, const QString &bun ...@@ -145,6 +152,7 @@ void IosRunner::handleGotInferiorPid(IosToolHandler *handler, const QString &bun
const QString &deviceId, Q_PID pid) const QString &deviceId, Q_PID pid)
{ {
Q_UNUSED(bundlePath); Q_UNUSED(deviceId); Q_UNUSED(bundlePath); Q_UNUSED(deviceId);
m_pid = pid;
if (m_toolHandler == handler) if (m_toolHandler == handler)
emit gotInferiorPid(pid); emit gotInferiorPid(pid);
} }
......
...@@ -89,6 +89,7 @@ private: ...@@ -89,6 +89,7 @@ private:
ProjectExplorer::IDevice::ConstPtr m_device; ProjectExplorer::IDevice::ConstPtr m_device;
bool m_debuggingMode; bool m_debuggingMode;
bool m_cleanExit; bool m_cleanExit;
Q_PID m_pid;
}; };
} // namespace Internal } // namespace Internal
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment