diff --git a/monitor.c b/monitor.c index d353c0e6458244e9caba835a8708a5904e92e09c..5ce2c58b76fa6ae07f8dd2f351cd15b00e908621 100644 --- a/monitor.c +++ b/monitor.c @@ -4651,8 +4651,11 @@ void monitor_cleanup(void) monitor_destroyed = true; QTAILQ_FOREACH_SAFE(mon, &mon_list, entry, next) { QTAILQ_REMOVE(&mon_list, mon, entry); + /* Permit QAPI event emission from character frontend release */ + qemu_mutex_unlock(&monitor_lock); monitor_flush(mon); monitor_data_destroy(mon); + qemu_mutex_lock(&monitor_lock); g_free(mon); } qemu_mutex_unlock(&monitor_lock);