summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2022-07-30 12:14:36 +0200
committermouse <[email protected]>2022-08-15 13:06:11 +0800
commitb0c94c09881af61634011a61c10b947e37de3030 (patch)
tree93818c4ca0d5c34c5a2874ff69161a5fb5ee286b
parentb4a6c7c87674a36daba7bc158f884037fa5c3f7d (diff)
downloadmarco-b0c94c09881af61634011a61c10b947e37de3030.tar.bz2
marco-b0c94c09881af61634011a61c10b947e37de3030.tar.xz
ui: avoid 'g_object_unref (NULL)'
-rw-r--r--src/ui/ui.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ui/ui.c b/src/ui/ui.c
index 4935f77c..9976c701 100644
--- a/src/ui/ui.c
+++ b/src/ui/ui.c
@@ -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;