Dmitry Timoshkov : dllhost: Periodically call CoFreeUnusedLibraries().

Alexandre Julliard julliard at winehq.org
Thu Mar 10 16:10:15 CST 2022


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

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Wed Mar  9 10:45:53 2022 +0300

dllhost: Periodically call CoFreeUnusedLibraries().

Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/dllhost/dllhost.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/programs/dllhost/dllhost.c b/programs/dllhost/dllhost.c
index 241b79d13a0..dc89c978510 100644
--- a/programs/dllhost/dllhost.c
+++ b/programs/dllhost/dllhost.c
@@ -352,7 +352,8 @@ int WINAPI wWinMain(HINSTANCE hinst, HINSTANCE previnst, LPWSTR cmdline, int sho
             goto cleanup;
         }
 
-        WaitForSingleObject(surrogate.event, INFINITE);
+        while (WaitForSingleObject(surrogate.event, 30000) != WAIT_OBJECT_0)
+            CoFreeUnusedLibraries();
     }
 
 cleanup:




More information about the wine-cvs mailing list