diff --git a/ui/vnc.c b/ui/vnc.c index e3f857cc90..3ce3a5beec 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -1024,6 +1024,11 @@ static int find_and_clear_dirty_height(VncState *vs, static int vnc_update_client(VncState *vs, int has_dirty, bool sync) { + if (vs->disconnecting) { + vnc_disconnect_finish(vs); + return 0; + } + vs->has_dirty += has_dirty; if (vs->need_update && !vs->disconnecting) { VncDisplay *vd = vs->vd;