[Spice-commits] src/spice-widget.c

Pavel Grunt pgrunt at kemper.freedesktop.org
Thu Mar 2 06:25:16 UTC 2017


 src/spice-widget.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 24ea304da8327090176cdea01349902be91526d0
Author: Pavel Grunt <pgrunt at redhat.com>
Date:   Tue Feb 28 15:07:46 2017 +0100

    spice-display: Check validity of cursor before unref
    
    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.
    
    Signed-off-by: Victor Toso <victortoso at redhat.com>

diff --git a/src/spice-widget.c b/src/spice-widget.c
index ed9a664..9a7ea56 100644
--- a/src/spice-widget.c
+++ b/src/spice-widget.c
@@ -1074,7 +1074,7 @@ static gboolean do_pointer_grab(SpiceDisplay *display)
     }
 
 end:
-    g_object_unref(blank);
+    g_clear_object(&blank);
     return grab_successful;
 }
 
@@ -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);


More information about the Spice-commits mailing list