← Back to team overview

ayatana-commits team mailing list archive

[Merge] lp:~mterry/indicator-appmenu/check-matcher-return into lp:indicator-appmenu

 

Michael Terry has proposed merging lp:~mterry/indicator-appmenu/check-matcher-return into lp:indicator-appmenu.

Requested reviews:
  Indicator Applet Developers (indicator-applet-developers)

For more details, see:
https://code.launchpad.net/~mterry/indicator-appmenu/check-matcher-return/+merge/47437

bamf_matcher_get_application_for_xid can return NULL if the XID was not matched to an app.  So its return value should be checked for nonNULLness before being passed to g_object_ref and such.
-- 
https://code.launchpad.net/~mterry/indicator-appmenu/check-matcher-return/+merge/47437
Your team ayatana-commits is subscribed to branch lp:indicator-appmenu.
=== modified file 'src/window-menus.c'
--- src/window-menus.c	2011-01-17 15:47:55 +0000
+++ src/window-menus.c	2011-01-25 18:25:10 +0000
@@ -409,8 +409,10 @@
 	}
 
 	priv->app = bamf_matcher_get_application_for_xid(bamf_matcher_get_default(), windowid);
-	g_object_ref(priv->app);
-	priv->window_removed_id = g_signal_connect(G_OBJECT(priv->app), "window-removed", G_CALLBACK(window_removed), newmenu);
+	if (priv->app) {
+		g_object_ref(priv->app);
+		priv->window_removed_id = g_signal_connect(G_OBJECT(priv->app), "window-removed", G_CALLBACK(window_removed), newmenu);
+	}
 
 	return newmenu;
 }


Follow ups