aboutsummaryrefslogtreecommitdiff
path: root/src/app-menu-item.c
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-04-20 14:12:44 -0500
committerTed Gould <ted@canonical.com>2009-04-20 14:12:44 -0500
commitb5159bc66b25208344bb456f968cf6494815045b (patch)
treeb423faa7ab9b94e4249e75548c3a123fb3c82227 /src/app-menu-item.c
parentf30fe10fea03b79da41d82f8ea276291a9624fcf (diff)
downloadayatana-indicator-messages-b5159bc66b25208344bb456f968cf6494815045b.tar.gz
ayatana-indicator-messages-b5159bc66b25208344bb456f968cf6494815045b.tar.bz2
ayatana-indicator-messages-b5159bc66b25208344bb456f968cf6494815045b.zip
Freeing the appinfo and type from the application object on finalize
Diffstat (limited to 'src/app-menu-item.c')
-rw-r--r--src/app-menu-item.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/app-menu-item.c b/src/app-menu-item.c
index d4536ac..f6472af 100644
--- a/src/app-menu-item.c
+++ b/src/app-menu-item.c
@@ -136,6 +136,14 @@ app_menu_item_finalize (GObject *object)
AppMenuItem * self = APP_MENU_ITEM(object);
AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
+ if (priv->type != NULL) {
+ g_free(priv->type);
+ }
+
+ if (priv->appinfo != NULL) {
+ g_object_unref(priv->appinfo);
+ }
+
G_OBJECT_CLASS (app_menu_item_parent_class)->finalize (object);
return;
@@ -181,8 +189,14 @@ type_cb (IndicateListener * listener, IndicateListenerServer * server, gchar * v
if (priv->type != NULL) {
g_free(priv->type);
+ priv->type = NULL;
}
+ if (value == NULL) {
+ g_warning("Type value is NULL, that shouldn't really happen");
+ return;
+ }
+
priv->type = g_strdup(value);
if (!(!g_strcmp0(priv->type, "message.instant") || !g_strcmp0(priv->type, "message.micro") || !g_strcmp0(priv->type, "message.im"))) {