Symbian: ensure that terminated application is killed

This commit is contained in:
Pawel Polanski
2011-02-08 15:25:20 +01:00
parent 4eefeccfd7
commit ce5b57c8a5
2 changed files with 7 additions and 6 deletions

View File

@@ -1023,7 +1023,7 @@ void CodaGdbAdapter::startAdapter()
setupTrkDeviceSignals(); setupTrkDeviceSignals();
codaSocket = QSharedPointer<QTcpSocket>(new QTcpSocket); codaSocket = QSharedPointer<QTcpSocket>(new QTcpSocket);
m_codaDevice->setDevice(codaSocket); m_codaDevice->setDevice(codaSocket);
m_trkIODevice = codaSocket; m_codaSocketIODevice = codaSocket;
} else { } else {
m_codaDevice = SymbianUtils::SymbianDeviceManager::instance()->getTcfPort(parameters.remoteChannel); m_codaDevice = SymbianUtils::SymbianDeviceManager::instance()->getTcfPort(parameters.remoteChannel);
bool ok = m_codaDevice && m_codaDevice->device()->isOpen(); bool ok = m_codaDevice && m_codaDevice->device()->isOpen();
@@ -1190,21 +1190,22 @@ void CodaGdbAdapter::cleanup()
{ {
delete m_gdbServer; delete m_gdbServer;
m_gdbServer = 0; m_gdbServer = 0;
if (!m_trkIODevice.isNull()) { if (!m_codaSocketIODevice.isNull()) {
QAbstractSocket *socket = qobject_cast<QAbstractSocket *>(m_trkIODevice.data()); QAbstractSocket *socket = qobject_cast<QAbstractSocket *>(m_codaSocketIODevice.data());
const bool isOpen = socket const bool isOpen = socket
? socket->state() == QAbstractSocket::ConnectedState ? socket->state() == QAbstractSocket::ConnectedState
: m_trkIODevice->isOpen(); : m_codaSocketIODevice->isOpen();
if (isOpen) { if (isOpen) {
sendRunControlTerminateCommand(); //ensure process is stopped after being suspended sendRunControlTerminateCommand(); //ensure process is stopped after being suspended
if (socket) { if (socket) {
socket->disconnect(); socket->disconnect();
} else { } else {
m_trkIODevice->close(); m_codaSocketIODevice->close();
} }
} }
} //!m_trkIODevice.isNull() } //!m_trkIODevice.isNull()
if (m_codaDevice) { if (m_codaDevice) {
sendRunControlTerminateCommand(); //ensure process is stopped after being suspended
disconnect(m_codaDevice.data(), 0, this, 0); disconnect(m_codaDevice.data(), 0, this, 0);
SymbianUtils::SymbianDeviceManager::instance()->releaseTcfPort(m_codaDevice); SymbianUtils::SymbianDeviceManager::instance()->releaseTcfPort(m_codaDevice);
} }

View File

@@ -147,7 +147,7 @@ private:
int m_stopReason; int m_stopReason;
QSharedPointer<Coda::CodaDevice> m_codaDevice; QSharedPointer<Coda::CodaDevice> m_codaDevice;
QSharedPointer<QIODevice> m_trkIODevice; QSharedPointer<QIODevice> m_codaSocketIODevice;
// //
// Gdb // Gdb