mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-06 10:50:08 +00:00
Small cleanup
Use g_clear_object in gtkdnd.c.
This commit is contained in:
parent
d3475f7a72
commit
1e51398e9a
14
gtk/gtkdnd.c
14
gtk/gtkdnd.c
@ -853,11 +853,7 @@ gtk_drag_get_cursor (GtkWidget *widget,
|
|||||||
if (!info)
|
if (!info)
|
||||||
{
|
{
|
||||||
for (i = 0 ; i < G_N_ELEMENTS (drag_cursors) - 1; i++)
|
for (i = 0 ; i < G_N_ELEMENTS (drag_cursors) - 1; i++)
|
||||||
if (drag_cursors[i].cursor != NULL)
|
g_clear_object (&drag_cursors[i].cursor);
|
||||||
{
|
|
||||||
g_object_unref (drag_cursors[i].cursor);
|
|
||||||
drag_cursors[i].cursor = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0 ; i < G_N_ELEMENTS (drag_cursors) - 1; i++)
|
for (i = 0 ; i < G_N_ELEMENTS (drag_cursors) - 1; i++)
|
||||||
@ -867,10 +863,7 @@ gtk_drag_get_cursor (GtkWidget *widget,
|
|||||||
if (drag_cursors[i].cursor != NULL)
|
if (drag_cursors[i].cursor != NULL)
|
||||||
{
|
{
|
||||||
if (display != gdk_cursor_get_display (drag_cursors[i].cursor))
|
if (display != gdk_cursor_get_display (drag_cursors[i].cursor))
|
||||||
{
|
g_clear_object (&drag_cursors[i].cursor);
|
||||||
g_object_unref (drag_cursors[i].cursor);
|
|
||||||
drag_cursors[i].cursor = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (drag_cursors[i].cursor == NULL)
|
if (drag_cursors[i].cursor == NULL)
|
||||||
@ -897,8 +890,7 @@ gtk_drag_get_cursor (GtkWidget *widget,
|
|||||||
if (display == gdk_cursor_get_display (info->drag_cursors[i]))
|
if (display == gdk_cursor_get_display (info->drag_cursors[i]))
|
||||||
return info->drag_cursors[i];
|
return info->drag_cursors[i];
|
||||||
|
|
||||||
g_object_unref (info->drag_cursors[i]);
|
g_clear_object (&info->drag_cursors[i]);
|
||||||
info->drag_cursors[i] = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
scale = gtk_widget_get_scale_factor (widget);
|
scale = gtk_widget_get_scale_factor (widget);
|
||||||
|
Loading…
Reference in New Issue
Block a user