[Spice-devel] [PATCH spice-gtk] spice-display: Check validity of cursor before unref

Pavel Grunt pgrunt at redhat.com
Tue Feb 28 14:07:46 UTC 2017


Since 62f9144d6c5ac06cd76b76176644622c43c08541 the mouse cursor
is created when the widget is realized. The unref must be prevented.

The issue can happen when connecting using remote-viewer to
a multimonitor VM.
---
 src/spice-widget.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/spice-widget.c b/src/spice-widget.c
index ed9a664..1e69129 100644
--- a/src/spice-widget.c
+++ b/src/spice-widget.c
@@ -2767,7 +2767,7 @@ static void cursor_move(SpiceCursorChannel *channel, gint x, gint y, gpointer da
 
     /* apparently we have to restore cursor when "cursor_move" */
     if (d->show_cursor != NULL) {
-        g_object_unref(d->mouse_cursor);
+        g_clear_object(&d->mouse_cursor);
         d->mouse_cursor = d->show_cursor;
         d->show_cursor = NULL;
         update_mouse_pointer(display);
-- 
2.11.1



More information about the Spice-devel mailing list