summaryrefslogtreecommitdiff
path: root/protocols/Skype/src/skype_runtime.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2013-05-16 20:19:23 +0000
committerAlexander Lantsev <aunsane@gmail.com>2013-05-16 20:19:23 +0000
commit555571882cbeaca6051387f03454121898f318c4 (patch)
tree9c7f391ee4edaadf938e740671332077227c6bfa /protocols/Skype/src/skype_runtime.cpp
parenta7a30ecec3c72acadecbbd2a2e820f685ebd6240 (diff)
- fix for skypekit closing
git-svn-id: http://svn.miranda-ng.org/main/trunk@4688 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
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