From e376f98224536ca3c9ff0e85a01e276c9f2a7e44 Mon Sep 17 00:00:00 2001 From: mio Date: Fri, 11 Apr 2025 11:50:10 +0800 Subject: [PATCH] Flush tb in uc_close --- uc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/uc.c b/uc.c index 57cb6e8c..033a26f0 100644 --- a/uc.c +++ b/uc.c @@ -504,6 +504,9 @@ uc_err uc_close(uc_engine *uc) return UC_ERR_OK; } + // Flush all translation buffers or we leak memory allocated by MMU + uc->tb_flush(uc); + // Cleanup internally. if (uc->release) { uc->release(uc->tcg_ctx);