accel: Fix a leak on Windows HAX

hThread is only used on the error path in hax_kick_vcpu_thread().

Fixes: b0cb0a66d6 ("Plumb the HAXM-based hardware acceleration support")
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230624174121.11508-5-philmd@linaro.org>
This commit is contained in:
Philippe Mathieu-Daudé 2023-04-05 09:29:59 +02:00
parent af03d22a0a
commit 43477340c3
1 changed files with 3 additions and 0 deletions

View File

@ -205,6 +205,9 @@ int hax_vcpu_destroy(CPUState *cpu)
*/
hax_close_fd(vcpu->fd);
hax_global.vm->vcpus[vcpu->vcpu_id] = NULL;
#ifdef _WIN32
CloseHandle(cpu->hThread);
#endif
g_free(vcpu);
return 0;
}