fixed lousy ipc client/server cleanup and shutdown doubled timeout.

This commit is contained in:
Nick Bolton 2012-07-13 17:08:00 +00:00
parent db3ea4ab9c
commit 738c321bae
4 changed files with 4 additions and 6 deletions

View File

@ -46,7 +46,6 @@ CIpcClient::init()
CIpcClient::~CIpcClient() CIpcClient::~CIpcClient()
{ {
disconnect();
} }
void void

View File

@ -184,6 +184,7 @@ CIpcClientProxy::disconnect()
{ {
LOG((CLOG_DEBUG "ipc client proxy disconnect")); LOG((CLOG_DEBUG "ipc client proxy disconnect"));
m_disconnecting = true; m_disconnecting = true;
m_stream.close();
EVENTQUEUE->addEvent(CEvent(getDisconnectedEvent(), this)); EVENTQUEUE->addEvent(CEvent(getDisconnectedEvent(), this));
} }

View File

@ -38,8 +38,6 @@ CIpcServerProxy::~CIpcServerProxy()
{ {
EVENTQUEUE->removeHandler(m_stream.getInputReadyEvent(), EVENTQUEUE->removeHandler(m_stream.getInputReadyEvent(),
m_stream.getEventTarget()); m_stream.getEventTarget());
m_stream.close();
} }
void void

View File

@ -276,7 +276,7 @@ CMSWindowsRelauncher::mainLoop(void*)
if (launched) { if (launched) {
LOG((CLOG_DEBUG "closing existing process to make way for new one")); LOG((CLOG_DEBUG "closing existing process to make way for new one"));
shutdownProcess(pi.hProcess, pi.dwProcessId, 10); shutdownProcess(pi.hProcess, pi.dwProcessId, 20);
launched = false; launched = false;
} }
@ -365,7 +365,7 @@ CMSWindowsRelauncher::mainLoop(void*)
if (launched) { if (launched) {
LOG((CLOG_DEBUG "terminated running process on exit")); LOG((CLOG_DEBUG "terminated running process on exit"));
shutdownProcess(pi.hProcess, pi.dwProcessId, 10); shutdownProcess(pi.hProcess, pi.dwProcessId, 20);
} }
LOG((CLOG_DEBUG "relauncher main thread finished")); LOG((CLOG_DEBUG "relauncher main thread finished"));
@ -506,7 +506,7 @@ CMSWindowsRelauncher::shutdownExistingProcesses()
_stricmp(entry.szExeFile, "synergys.exe") == 0) { _stricmp(entry.szExeFile, "synergys.exe") == 0) {
HANDLE handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, entry.th32ProcessID); HANDLE handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, entry.th32ProcessID);
shutdownProcess(handle, entry.th32ProcessID, 1); shutdownProcess(handle, entry.th32ProcessID, 10);
} }
} }