[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.
This commit is contained in:
Quantum authored and Geoffrey McRae committed 2021-02-27 17:38:12 +11:00
1 parent 952f50eb8c
commit 54da11a206
1 file changed
+1 -2
+1 -2
View File
@@ -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: