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: