diff options
Diffstat (limited to 'chardev/char-fe.c')
-rw-r--r-- | chardev/char-fe.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/chardev/char-fe.c b/chardev/char-fe.c index 341221d029..3f90f0567c 100644 --- a/chardev/char-fe.c +++ b/chardev/char-fe.c @@ -211,7 +211,7 @@ unavailable: return false; } -void qemu_chr_fe_deinit(CharBackend *b) +void qemu_chr_fe_deinit(CharBackend *b, bool del) { assert(b); @@ -224,6 +224,9 @@ void qemu_chr_fe_deinit(CharBackend *b) MuxChardev *d = MUX_CHARDEV(b->chr); d->backends[b->tag] = NULL; } + if (del) { + object_unparent(OBJECT(b->chr)); + } b->chr = NULL; } } |