[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 03/14] accel: Fix a leak on Windows HAX
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 03/14] accel: Fix a leak on Windows HAX |
Date: |
Wed, 5 Apr 2023 12:18:00 +0200 |
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>
---
target/i386/hax/hax-all.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/target/i386/hax/hax-all.c b/target/i386/hax/hax-all.c
index 3e5992a63b..a2321a1eff 100644
--- a/target/i386/hax/hax-all.c
+++ b/target/i386/hax/hax-all.c
@@ -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;
}
--
2.38.1
- [PATCH 00/14] accel: Share CPUState accel context (HAX/NVMM/WHPX/HVF), Philippe Mathieu-Daudé, 2023/04/05
- [PATCH 01/14] accel: Document generic accelerator headers, Philippe Mathieu-Daudé, 2023/04/05
- [PATCH 02/14] accel: Remove unused hThread variable on TCG/WHPX, Philippe Mathieu-Daudé, 2023/04/05
- [PATCH 03/14] accel: Fix a leak on Windows HAX,
Philippe Mathieu-Daudé <=
- [PATCH 04/14] accel: Destroy HAX vCPU threads once done, Philippe Mathieu-Daudé, 2023/04/05
- [PATCH 05/14] accel: Rename 'hax_vcpu' as 'accel' in CPUState, Philippe Mathieu-Daudé, 2023/04/05
- [PATCH 06/14] accel: Use a typedef for struct hax_vcpu_state, Philippe Mathieu-Daudé, 2023/04/05
- [PATCH 07/14] accel: Rename struct hax_vcpu_state -> struct AccelvCPUState, Philippe Mathieu-Daudé, 2023/04/05
- [PATCH 08/14] accel: Move HAX hThread to accelerator context, Philippe Mathieu-Daudé, 2023/04/05