fix GdkCursor memory leaks
This commit is contained in:
@@ -116,6 +116,7 @@ void gtk_assert_dialog_process_backtrace (GtkAssertDialog *dlg)
|
|||||||
GdkDisplay* display = gdk_window_get_display(parent);
|
GdkDisplay* display = gdk_window_get_display(parent);
|
||||||
GdkCursor* cur = gdk_cursor_new_for_display(display, GDK_WATCH);
|
GdkCursor* cur = gdk_cursor_new_for_display(display, GDK_WATCH);
|
||||||
gdk_window_set_cursor (parent, cur);
|
gdk_window_set_cursor (parent, cur);
|
||||||
|
g_object_unref(cur);
|
||||||
gdk_flush ();
|
gdk_flush ();
|
||||||
|
|
||||||
(*dlg->callback)(dlg->userdata);
|
(*dlg->callback)(dlg->userdata);
|
||||||
|
@@ -288,6 +288,8 @@ gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion *gdk_event,
|
|||||||
cursor = gdk_cursor_new_for_display(display, GDK_BOTTOM_RIGHT_CORNER);
|
cursor = gdk_cursor_new_for_display(display, GDK_BOTTOM_RIGHT_CORNER);
|
||||||
}
|
}
|
||||||
gdk_window_set_cursor(window, cursor);
|
gdk_window_set_cursor(window, cursor);
|
||||||
|
if (cursor)
|
||||||
|
g_object_unref(cursor);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user