← Back to team overview

ayatana-commits team mailing list archive

[Merge] lp:~ted/appmenu-gtk/unref-if-non-null into lp:appmenu-gtk

 

Ted Gould has proposed merging lp:~ted/appmenu-gtk/unref-if-non-null into lp:appmenu-gtk.

Requested reviews:
  Indicator Applet Developers (indicator-applet-developers)
Related bugs:
  #703988 (various) crashed with SIGSEGV in g_atomic_int_exchange_and_add()/g_variant_unref/?libappmenu.so/g_simple_async_result_complete
  https://bugs.launchpad.net/bugs/703988

For more details, see:
https://code.launchpad.net/~ted/appmenu-gtk/unref-if-non-null/+merge/48794

Don't unref the variant if it's NULL (usually error)
-- 
https://code.launchpad.net/~ted/appmenu-gtk/unref-if-non-null/+merge/48794
Your team ayatana-commits is subscribed to branch lp:appmenu-gtk.
=== modified file 'src/bridge.c'
--- src/bridge.c	2011-02-03 13:56:08 +0000
+++ src/bridge.c	2011-02-07 15:46:13 +0000
@@ -288,7 +288,12 @@
   AppWindowContext *context = (AppWindowContext *)user_data;
 
   GVariant * variants = g_dbus_proxy_call_finish(G_DBUS_PROXY(object), res, &error);
-  g_variant_unref(variants);
+
+  if (variants != NULL) {
+    /* Only unref variants if we get some.  Doing this hear instead of
+       with the error so that it's clear we don't use it. */
+    g_variant_unref(variants);
+  }
 
   if (error != NULL)
     {


Follow ups