mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2024-12-25 17:55:34 +00:00
943b9fc261
If device doesn't have parent assined before its realize is called, device_set_realized() will implicitly set parent to '/machine/unattached'. However device_set_realized() may fail after that point at several other points leaving not realized object dangling in '/machine/unattached' and as result caller of obj = object_new() obj->ref == 1 object_property_set_bool(obj,..., true, "realized",...) obj->ref == 2 if (fail) object_unref(obj); obj->ref == 1 will get object leak instead of expected object destruction. Fix it by making device_set_realized() to cleanup after itself in case of failure. Backports commit 69382d8b3e8600b349c191394d761dcb480502cf from qemu |
||
---|---|---|
.. | ||
machine.c | ||
Makefile.objs | ||
qdev.c |