[gtk+/gtk-2-24-quartz] Fix a segfault if the GAppInfo does not have an icon
- From: John Ralls <jralls src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-24-quartz] Fix a segfault if the GAppInfo does not have an icon
- Date: Wed, 23 Nov 2011 23:03:20 +0000 (UTC)
commit bb1291718c3c1e2dd615cf757f4206640aa87c27
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 20db4ab..8796cc3 100644
--- a/gdk/x11/gdkapplaunchcontext-x11.c
+++ b/gdk/x11/gdkapplaunchcontext-x11.c
@@ -340,13 +340,15 @@ _gdk_windowing_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]