From 54da11a20682923ea53a1ca35e0c547679dc2275 Mon Sep 17 00:00:00 2001 From: Quantum Date: Fri, 26 Feb 2021 23:11:20 -0500 Subject: [PATCH] [host] free capture interface on exit This is needed for proper cleanup. Freeing the capture interface also avoids a crash when using the NvFBC backend. This is because we moved the mouse hook removal to nvfbc_free. If nvfbc_free is not called before we start freeing LGMP memory, the mouse hook would end up writing the cursor position into an invalid memory address, causing an access violation. --- host/src/app.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/host/src/app.c b/host/src/app.c index b38d1dab..534869b4 100644 --- a/host/src/app.c +++ b/host/src/app.c @@ -566,8 +566,6 @@ int app_main(int argc, char * argv[]) DEBUG_ERROR("Failed to create the LGMP timer"); iface->deinit(); - iface->free(); - goto fail_timer; } @@ -685,6 +683,7 @@ fail_capture: lgTimerDestroy(app.lgmpTimer); fail_timer: + iface->free(); LG_LOCK_FREE(app.pointerLock); fail_lgmp: