diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2013-05-16 20:19:23 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2013-05-16 20:19:23 +0000 |
commit | 555571882cbeaca6051387f03454121898f318c4 (patch) | |
tree | 9c7f391ee4edaadf938e740671332077227c6bfa | |
parent | a7a30ecec3c72acadecbbd2a2e820f685ebd6240 (diff) |
- fix for skypekit closing
git-svn-id: http://svn.miranda-ng.org/main/trunk@4688 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | protocols/Skype/src/skype_instances.cpp | 2 | ||||
-rw-r--r-- | protocols/Skype/src/skype_proto.cpp | 2 | ||||
-rw-r--r-- | protocols/Skype/src/skype_runtime.cpp | 10 |
3 files changed, 10 insertions, 4 deletions
diff --git a/protocols/Skype/src/skype_instances.cpp b/protocols/Skype/src/skype_instances.cpp index 0b83b767c6..5f67e28ebd 100644 --- a/protocols/Skype/src/skype_instances.cpp +++ b/protocols/Skype/src/skype_instances.cpp @@ -58,6 +58,8 @@ CSkypeProto* CSkypeProto::InitSkypeProto(const char* protoName, const wchar_t* u int CSkypeProto::UninitSkypeProto(CSkypeProto* ppro)
{
+ ppro->stop();
+
ppro->StopSkypeRuntime();
CSkypeProto::instanceList.remove(ppro);
diff --git a/protocols/Skype/src/skype_proto.cpp b/protocols/Skype/src/skype_proto.cpp index a9ce9c5e84..587eb65735 100644 --- a/protocols/Skype/src/skype_proto.cpp +++ b/protocols/Skype/src/skype_proto.cpp @@ -42,8 +42,6 @@ CSkypeProto::~CSkypeProto() this->password = NULL;
}
- this->stop();
-
::ProtoDestructor(this);
}
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 |