Akihiro Sagawa : imm32/tests: Terminate the thread cleanly.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Feb 12 09:47:44 CST 2016


Module: wine
Branch: master
Commit: 2cd81c149d1ffe267ecc69c8aac60400a26b1877
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=2cd81c149d1ffe267ecc69c8aac60400a26b1877

Author: Akihiro Sagawa <sagawa.aki at gmail.com>
Date:   Thu Feb 11 23:03:30 2016 +0900

imm32/tests: Terminate the thread cleanly.

Signed-off-by: Akihiro Sagawa <sagawa.aki at gmail.com>
Signed-off-by: Aric Stewart <aric at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/imm32/tests/imm32.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/dlls/imm32/tests/imm32.c b/dlls/imm32/tests/imm32.c
index 9ab55f3..eb544bb 100644
--- a/dlls/imm32/tests/imm32.c
+++ b/dlls/imm32/tests/imm32.c
@@ -640,7 +640,10 @@ static void test_ImmThreads(void)
     ImmReleaseContext(hwnd,himc);
 
     SendMessageA(threadinfo.hwnd, WM_CLOSE, 0, 0);
-    TerminateThread(hThread, 1);
+    rc = PostThreadMessageA(dwThreadId, WM_QUIT, 1, 0);
+    ok(rc == 1, "PostThreadMessage should succeed\n");
+    WaitForSingleObject(hThread, INFINITE);
+    CloseHandle(hThread);
 
     himc = ImmGetContext(GetDesktopWindow());
     ok(himc == NULL, "Should not be able to get himc from other process window\n");
@@ -842,6 +845,7 @@ static void test_ImmDefaultHwnd(void)
     WaitForSingleObject(thread, INFINITE);
     ok(thread_ime_wnd != def1, "thread_ime_wnd == def1\n");
     ok(!IsWindow(thread_ime_wnd), "thread_ime_wnd was not destroyed\n");
+    CloseHandle(thread);
 
     ImmReleaseContext(hwnd, imc1);
     ImmReleaseContext(hwnd, imc3);




More information about the wine-cvs mailing list