mirror of
https://github.com/debauchee/barrier.git
synced 2026-11-04 22:45:23 +08:00
fixed lousy ipc client/server cleanup and shutdown doubled timeout.
This commit is contained in:
@@ -46,7 +46,6 @@ CIpcClient::init()
|
||||
|
||||
CIpcClient::~CIpcClient()
|
||||
{
|
||||
disconnect();
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -184,6 +184,7 @@ CIpcClientProxy::disconnect()
|
||||
{
|
||||
LOG((CLOG_DEBUG "ipc client proxy disconnect"));
|
||||
m_disconnecting = true;
|
||||
m_stream.close();
|
||||
EVENTQUEUE->addEvent(CEvent(getDisconnectedEvent(), this));
|
||||
}
|
||||
|
||||
|
||||
@@ -38,8 +38,6 @@ CIpcServerProxy::~CIpcServerProxy()
|
||||
{
|
||||
EVENTQUEUE->removeHandler(m_stream.getInputReadyEvent(),
|
||||
m_stream.getEventTarget());
|
||||
|
||||
m_stream.close();
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -276,7 +276,7 @@ CMSWindowsRelauncher::mainLoop(void*)
|
||||
|
||||
if (launched) {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -365,7 +365,7 @@ CMSWindowsRelauncher::mainLoop(void*)
|
||||
|
||||
if (launched) {
|
||||
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"));
|
||||
@@ -506,7 +506,7 @@ CMSWindowsRelauncher::shutdownExistingProcesses()
|
||||
_stricmp(entry.szExeFile, "synergys.exe") == 0) {
|
||||
|
||||
HANDLE handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, entry.th32ProcessID);
|
||||
shutdownProcess(handle, entry.th32ProcessID, 1);
|
||||
shutdownProcess(handle, entry.th32ProcessID, 10);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user