summaryrefslogtreecommitdiff
path: root/protocols/Skype/src/skype_runtime.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Skype/src/skype_runtime.cpp')
-rw-r--r--protocols/Skype/src/skype_runtime.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/protocols/Skype/src/skype_runtime.cpp b/protocols/Skype/src/skype_runtime.cpp
index a283efd259..1844d2109a 100644
--- a/protocols/Skype/src/skype_runtime.cpp
+++ b/protocols/Skype/src/skype_runtime.cpp
@@ -88,8 +88,14 @@ int CSkypeProto::StartSkypeRuntime(const wchar_t *profileName)
void CSkypeProto::StopSkypeRuntime()
{
- ::TerminateProcess(this->skypeKitProcessInfo.hProcess, 0);
+ ::PostThreadMessage(this->skypeKitProcessInfo.dwThreadId, WM_CLOSE, 0, 0);
+ ::WaitForSingleObject(this->skypeKitProcessInfo.hProcess, 1500);
+
+ DWORD dwExitCode = 0;
+ ::GetExitCodeProcess(this->skypeKitProcessInfo.hProcess, &dwExitCode);
+ if (dwExitCode == STILL_ACTIVE)
+ ::TerminateProcess(this->skypeKitProcessInfo.hProcess, 0); // Zero is the exit code
+
::CloseHandle(this->skypeKitProcessInfo.hThread);
::CloseHandle(this->skypeKitProcessInfo.hProcess);
-
} \ No newline at end of file