diff options
Diffstat (limited to 'protocols/Skype')
-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 |