Small cleanup

Use g_clear_object in gtkdnd.c.
This commit is contained in:
Matthias Clasen 2015-10-08 07:20:26 -04:00
parent d3475f7a72
commit 1e51398e9a

View File

@ -853,11 +853,7 @@ gtk_drag_get_cursor (GtkWidget *widget,
if (!info)
{
for (i = 0 ; i < G_N_ELEMENTS (drag_cursors) - 1; i++)
if (drag_cursors[i].cursor != NULL)
{
g_object_unref (drag_cursors[i].cursor);
drag_cursors[i].cursor = NULL;
}
g_clear_object (&drag_cursors[i].cursor);
}
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 (display != gdk_cursor_get_display (drag_cursors[i].cursor))
{
g_object_unref (drag_cursors[i].cursor);
drag_cursors[i].cursor = NULL;
}
g_clear_object (&drag_cursors[i].cursor);
}
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]))
return info->drag_cursors[i];
g_object_unref (info->drag_cursors[i]);
info->drag_cursors[i] = NULL;
g_clear_object (&info->drag_cursors[i]);
}
scale = gtk_widget_get_scale_factor (widget);