mirror of
https://github.com/lubosz/overte.git
synced 2025-04-25 14:13:05 +02:00
Merge pull request #4648 from ctrlaltdavid/dde-shutdown
Terminate DDE process gracefully
This commit is contained in:
commit
e780d8e482
1 changed files with 4 additions and 2 deletions
|
@ -182,9 +182,10 @@ void DdeFaceTracker::setEnabled(bool enabled) {
|
|||
_udpSocket.bind(_host, _serverPort);
|
||||
}
|
||||
|
||||
const char* DDE_EXIT_COMMAND = "exit";
|
||||
|
||||
if (enabled && !_ddeProcess) {
|
||||
// Terminate any existing DDE process, perhaps left running after an Interface crash
|
||||
const char* DDE_EXIT_COMMAND = "exit";
|
||||
_udpSocket.writeDatagram(DDE_EXIT_COMMAND, DDE_SERVER_ADDR, _controlPort);
|
||||
|
||||
qDebug() << "[Info] DDE Face Tracker Starting";
|
||||
|
@ -194,7 +195,8 @@ void DdeFaceTracker::setEnabled(bool enabled) {
|
|||
}
|
||||
|
||||
if (!enabled && _ddeProcess) {
|
||||
_ddeProcess->kill(); // More robust than trying to send an "exit" command to DDE
|
||||
_udpSocket.writeDatagram(DDE_EXIT_COMMAND, DDE_SERVER_ADDR, _controlPort);
|
||||
delete _ddeProcess;
|
||||
_ddeProcess = NULL;
|
||||
qDebug() << "[Info] DDE Face Tracker Stopped";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue