[gtk+] Fix a segfault if the GAppInfo does not have an icon
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Fix a segfault if the GAppInfo does not have an icon
- Date: Tue, 13 Sep 2011 15:41:56 +0000 (UTC)
commit 14df59d47c02e65e9ece747273a4bd2fa2dde97b
Author: Richard Hughes <richard hughsie com>
Date: Tue Sep 13 16:16:28 2011 +0100
Fix a segfault if the GAppInfo does not have an icon
This fixes the following backtrace:
0 g_logv (log_domain=0x7ffff60461a4 "GLib-GObject", log_level=<optimized out>,
format=0x7ffff599c322 "%s: assertion `%s' failed", args1=0x7fffffffc418) at gmessages.c:577
1 0x00007ffff59312d2 in g_log (log_domain=<optimized out>, log_level=<optimized out>,
format=<optimized out>) at gmessages.c:591
2 0x00007ffff601c3c7 in g_object_ref (_object=0x0) at gobject.c:2648
3 0x00007ffff7721e22 in gdk_x11_app_launch_context_get_startup_notify_id (context=<optimized out>,
info=0x7fffe8004b40, files=<optimized out>) at gdkapplaunchcontext-x11.c:331
4 0x00007ffff62e60d0 in _g_desktop_app_info_launch_uris_internal (appinfo=0x7fffe8004b40, uris=0x0,
launch_context=0x7fffe401c800, spawn_flags=G_SPAWN_SEARCH_PATH, user_setup=0, user_setup_data=0x0,
pid_callback=0, pid_callback_data=0x0, error=0x7fffffffc848) at gdesktopappinfo.c:1269
5 0x00007ffff62e630a in g_desktop_app_info_launch_uris (appinfo=<optimized out>, uris=<optimized out>,
launch_context=<optimized out>, error=<optimized out>) at gdesktopappinfo.c:1341
6 0x00007ffff62e636b in g_desktop_app_info_launch (appinfo=0x7fffe8004b40, files=<optimized out>,
launch_context=0x7fffe401c800, error=0x7fffffffc848) at gdesktopappinfo.c:1388
gdk/x11/gdkapplaunchcontext-x11.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/gdk/x11/gdkapplaunchcontext-x11.c b/gdk/x11/gdkapplaunchcontext-x11.c
index ff4f1cd..825be75 100644
--- a/gdk/x11/gdkapplaunchcontext-x11.c
+++ b/gdk/x11/gdkapplaunchcontext-x11.c
@@ -328,13 +328,15 @@ gdk_x11_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
if (icon == NULL)
{
icon = g_app_info_get_icon (info);
- g_object_ref (icon);
+ if (icon != NULL)
+ g_object_ref (icon);
}
- if (icon)
- icon_name = gicon_to_string (icon);
-
- g_object_unref (icon);
+ if (icon != NULL)
+ {
+ icon_name = gicon_to_string (icon);
+ g_object_unref (icon);
+ }
}
binary_name = g_app_info_get_executable (info);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]