If the listener doesn't have associate ds / display state, it is already
unregistered.

Signed-off-by: Marc-André Lureau <[email protected]>
---
 ui/console.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ui/console.c b/ui/console.c
index 78b0ac27827..a9132e09eac 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -677,6 +677,9 @@ void unregister_displaychangelistener(DisplayChangeListener 
*dcl)
 {
     DisplayState *ds = dcl->ds;
     trace_displaychangelistener_unregister(dcl, dcl->ops->dpy_name);
+    if (!ds) {
+        return;
+    }
     if (dcl->con) {
         dcl->con->dcls--;
     }

-- 
2.53.0


Reply via email to