From f8d6a7d026be10ea4cdb486cfa945ad697403f26 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 11 Jan 2010 16:27:19 -0600 Subject: Initing and destroying the status_icon variable --- src/libappindicator/app-indicator.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/libappindicator/app-indicator.c') diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c index 9f0ca54..2650342 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -302,6 +302,8 @@ app_indicator_init (AppIndicator *self) priv->watcher_proxy = NULL; priv->connection = NULL; + priv->status_icon = NULL; + /* Put the object on DBus */ GError * error = NULL; priv->connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error); @@ -325,13 +327,21 @@ app_indicator_init (AppIndicator *self) static void app_indicator_dispose (GObject *object) { - AppIndicator *self = APP_INDICATOR (object); + AppIndicator *self = APP_INDICATOR (object); AppIndicatorPrivate *priv = self->priv; if (priv->status != APP_INDICATOR_STATUS_PASSIVE) { app_indicator_set_status(self, APP_INDICATOR_STATUS_PASSIVE); } + if (priv->status_icon != NULL) { + AppIndicatorClass * class = APP_INDICATOR_CLASS(object); + if (class->unfallback != NULL) { + class->unfallback(self, priv->status_icon); + } + priv->status_icon = NULL; + } + if (priv->menu != NULL) { g_object_unref(G_OBJECT(priv->menu)); priv->menu = NULL; -- cgit v1.2.3