From acc32983449ac9f7d67be2b69ce2ec5f76da98bf Mon Sep 17 00:00:00 2001 From: Quantum Date: Sat, 30 Jan 2021 01:06:56 -0500 Subject: [PATCH] [host] nvfbc: cleanup threads created by nvfbc_init on failure mouseHook_install and dwmForceComposition both create threads, but these are only freed in nvfbc_deinit which is not called if nvfbc_init fails. These should be freed if the pointer thread fails to be created, as nothing else could be cleaning it up. --- host/platform/Windows/capture/NVFBC/src/nvfbc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/host/platform/Windows/capture/NVFBC/src/nvfbc.c b/host/platform/Windows/capture/NVFBC/src/nvfbc.c index 62c635a5..dc3242c8 100644 --- a/host/platform/Windows/capture/NVFBC/src/nvfbc.c +++ b/host/platform/Windows/capture/NVFBC/src/nvfbc.c @@ -201,6 +201,8 @@ static bool nvfbc_init(void) if (!lgCreateThread("NvFBCPointer", pointerThread, NULL, &this->pointerThread)) { DEBUG_ERROR("Failed to create the NvFBCPointer thread"); + mouseHook_remove(); + dwmUnforceComposition(); return false; }