Bernhard Kölbl : windows.media.speech/tests: Fix some uses after release.

Alexandre Julliard julliard at winehq.org
Thu Apr 21 15:21:38 CDT 2022


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

Author: Bernhard Kölbl <besentv at gmail.com>
Date:   Wed Apr 20 21:34:08 2022 +0200

windows.media.speech/tests: Fix some uses after release.

Signed-off-by: Bernhard Kölbl <besentv at gmail.com>
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/windows.media.speech/tests/speech.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c
index ef75178f8c1..e4d65d3afd4 100644
--- a/dlls/windows.media.speech/tests/speech.c
+++ b/dlls/windows.media.speech/tests/speech.c
@@ -858,6 +858,8 @@ static void test_SpeechRecognizer(void)
         goto done;
     }
 
+    check_interface(factory, &IID_IAgileObject, TRUE);
+
     hr = IActivationFactory_QueryInterface(factory, &IID_ISpeechRecognizerFactory, (void **)&sr_factory);
     ok(hr == S_OK, "IActivationFactory_QueryInterface IID_ISpeechRecognizer failed, hr %#lx.\n", hr);
 
@@ -901,7 +903,6 @@ static void test_SpeechRecognizer(void)
     if (hr == S_OK)
     {
         check_refcount(inspectable, 1);
-        check_interface(factory, &IID_IAgileObject, TRUE);
 
         hr = IInspectable_QueryInterface(inspectable, &IID_ISpeechRecognizer, (void **)&recognizer);
         ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
@@ -1068,8 +1069,6 @@ static void test_SpeechRecognizer(void)
         todo_wine ok(hr == S_OK, "IAsyncInfo_get_Status failed, hr %#lx.\n", hr);
         todo_wine ok(async_status == Started || async_status == Completed, "Status was %#x.\n", async_status);
 
-        IAsyncInfo_Release(info);
-
         hr = IAsyncOperation_SpeechRecognitionCompilationResult_put_Completed(operation, &compilation_handler2.IAsyncHandler_Compilation_iface);
         todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
 
@@ -1081,6 +1080,9 @@ static void test_SpeechRecognizer(void)
         todo_wine ok(hr == S_OK, "IAsyncInfo_get_Status failed, hr %#lx.\n", hr);
         todo_wine ok(async_status == Completed, "Status was %#x.\n", async_status);
 
+        ref = IAsyncInfo_Release(info);
+        todo_wine ok(ref == 1, "Got unexpected ref %lu.\n", ref);
+
 skip_operation:
         ref = IAsyncOperation_SpeechRecognitionCompilationResult_Release(operation);
         ok(!ref, "Got unexpected ref %lu.\n", ref);




More information about the wine-cvs mailing list