aboutsummaryrefslogtreecommitdiff
path: root/chardev/msmouse.c
diff options
context:
space:
mode:
Diffstat (limited to 'chardev/msmouse.c')
-rw-r--r--chardev/msmouse.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/chardev/msmouse.c b/chardev/msmouse.c
index 9006703023..ab8fe981d6 100644
--- a/chardev/msmouse.c
+++ b/chardev/msmouse.c
@@ -247,7 +247,9 @@ static void char_msmouse_finalize(Object *obj)
{
MouseChardev *mouse = MOUSE_CHARDEV(obj);
- qemu_input_handler_unregister(mouse->hs);
+ if (mouse->hs) {
+ qemu_input_handler_unregister(mouse->hs);
+ }
fifo8_destroy(&mouse->outbuf);
}