clock: clear callback on unparent

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2024-11-28 13:21:13 +01:00
parent a3057c52f4
commit 4cc055039f
3 changed files with 18 additions and 17 deletions

View file

@ -87,11 +87,8 @@ void qdev_finalize_clocklist(DeviceState *dev)
if (!ncl->output && !ncl->alias) {
/*
* We kept a reference on the input clock to ensure it lives up to
* this point so we can safely remove the callback.
* It avoids having a callback to a deleted object if ncl->clock
* is still referenced somewhere else (eg: by a clock output).
* this point; it is used by the monitor to show the frequency.
*/
clock_clear_callback(ncl->clock);
object_unref(OBJECT(ncl->clock));
}
g_free(ncl->name);