Skip to content

Commit

Permalink
ui: avoid 'g_object_unref (NULL)'
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuj authored and zhuyaliang committed Aug 15, 2022
1 parent b4a6c7c commit b0c94c0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/ui/ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,10 +688,12 @@ load_window_icon_from_name (char *name, int size, int scale)
info = g_desktop_app_info_new (desktop_id);
gicon = g_app_info_get_icon (G_APP_INFO (info));
icon_info = gtk_icon_theme_lookup_by_gicon_for_scale (theme, gicon, size, scale, GTK_ICON_LOOKUP_FORCE_SIZE);
if (icon_info)
{
pixbuf = gtk_icon_info_load_icon (icon_info, NULL);
g_object_unref (icon_info);
}

pixbuf = gtk_icon_info_load_icon (icon_info, NULL);

g_object_unref (icon_info);
g_free (desktop_id);

return pixbuf;
Expand Down

0 comments on commit b0c94c0

Please sign in to comment.