diff options
Diffstat (limited to 'libdbusmenu-glib')
-rw-r--r-- | libdbusmenu-glib/client.c | 9 | ||||
-rw-r--r-- | libdbusmenu-glib/menuitem-proxy.c | 2 | ||||
-rw-r--r-- | libdbusmenu-glib/menuitem.c | 2 | ||||
-rw-r--r-- | libdbusmenu-glib/server.c | 2 |
4 files changed, 14 insertions, 1 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 588c940..a7f4da5 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -1057,7 +1057,12 @@ menuproxy_build_cb (GObject * object, GAsyncResult * res, gpointer user_data) /* If this wasn't cancelled, we should be good */ DbusmenuClient * client = DBUSMENU_CLIENT(user_data); + /* But let's check */ + g_return_if_fail(client != NULL); DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(client); + g_return_if_fail(priv != NULL); + + priv->menuproxy = proxy; if (priv->menuproxy_cancel != NULL) { @@ -1604,7 +1609,11 @@ about_to_show_cb (GObject * proxy, GAsyncResult * res, gpointer userdata) void dbusmenu_client_send_about_to_show(DbusmenuClient * client, gint id, void (*cb)(gpointer data), gpointer cb_data) { + g_return_if_fail(DBUSMENU_CLIENT(client)); + g_return_if_fail(id > 0); + DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(client); + g_return_if_fail(priv != NULL); about_to_show_t * data = g_new0(about_to_show_t, 1); data->client = client; diff --git a/libdbusmenu-glib/menuitem-proxy.c b/libdbusmenu-glib/menuitem-proxy.c index ae6a334..fdbd892 100644 --- a/libdbusmenu-glib/menuitem-proxy.c +++ b/libdbusmenu-glib/menuitem-proxy.c @@ -188,6 +188,7 @@ proxy_item_child_added (DbusmenuMenuitem * parent, DbusmenuMenuitem * child, gui DbusmenuMenuitemProxy * pmi = DBUSMENU_MENUITEM_PROXY(user_data); DbusmenuMenuitemProxy * child_pmi = dbusmenu_menuitem_proxy_new(child); dbusmenu_menuitem_child_add_position(DBUSMENU_MENUITEM(pmi), DBUSMENU_MENUITEM(child_pmi), position); + g_object_unref (child_pmi); return; } @@ -283,6 +284,7 @@ add_menuitem (DbusmenuMenuitemProxy * pmi, DbusmenuMenuitem * mi) for (child = children; child != NULL; child = g_list_next(child)) { DbusmenuMenuitemProxy * child_pmi = dbusmenu_menuitem_proxy_new(DBUSMENU_MENUITEM(child->data)); dbusmenu_menuitem_child_append(DBUSMENU_MENUITEM(pmi), DBUSMENU_MENUITEM(child_pmi)); + g_object_unref (child_pmi); } return; diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c index 4e037ee..c9c7736 100644 --- a/libdbusmenu-glib/menuitem.c +++ b/libdbusmenu-glib/menuitem.c @@ -1730,7 +1730,7 @@ dbusmenu_menuitem_send_about_to_show (DbusmenuMenuitem * mi, void (*cb) (Dbusmen #endif DbusmenuMenuitemClass * class = DBUSMENU_MENUITEM_GET_CLASS(mi); - if (class->send_about_to_show != NULL) { + if (class != NULL && class->send_about_to_show != NULL) { return class->send_about_to_show(mi, cb, cb_data); } else if (cb != NULL) { cb(mi, cb_data); diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index c7057df..9c085f7 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -1194,7 +1194,9 @@ error_quark (void) static void bus_get_layout (DbusmenuServer * server, GVariant * params, GDBusMethodInvocation * invocation) { + g_return_if_fail(DBUSMENU_IS_SERVER(server)); DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(server); + g_return_if_fail(priv != NULL); /* Input */ gint32 parent; |