Message ID | 20220528115044.30813-1-kkhaike@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | linux-user: fix memory leak when threads exit | expand |
diff --git a/linux-user/syscall.c b/linux-user/syscall.c index f55cdebee5..c653897d32 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -8567,6 +8567,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1, TaskState *ts = cpu->opaque; object_property_set_bool(OBJECT(cpu), "realized", false, NULL); + object_unparent(OBJECT(cpu)); object_unref(OBJECT(cpu)); /* * At this point the CPU should be unrealized and removed