diff options
author | Ted Gould <ted@gould.cx> | 2010-02-15 15:12:29 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-02-15 15:12:29 -0600 |
commit | a32a078bd850762c40577db69d589f660bf5e957 (patch) | |
tree | c935d91bf6e06617ca4b3db813d59b30afc76d71 /libindicator | |
parent | 3a95d842bbcd99afc85307ca1d699cc17072d986 (diff) | |
download | libayatana-indicator-a32a078bd850762c40577db69d589f660bf5e957.tar.gz libayatana-indicator-a32a078bd850762c40577db69d589f660bf5e957.tar.bz2 libayatana-indicator-a32a078bd850762c40577db69d589f660bf5e957.zip |
Getting some new private variables, and making sure they have a full lifecycle.
Diffstat (limited to 'libindicator')
-rw-r--r-- | libindicator/indicator-desktop-shortcuts.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/libindicator/indicator-desktop-shortcuts.c b/libindicator/indicator-desktop-shortcuts.c index 845f997..e6f5a69 100644 --- a/libindicator/indicator-desktop-shortcuts.c +++ b/libindicator/indicator-desktop-shortcuts.c @@ -30,6 +30,8 @@ License along with this library. If not, see typedef struct _IndicatorDesktopShortcutsPrivate IndicatorDesktopShortcutsPrivate; struct _IndicatorDesktopShortcutsPrivate { GKeyFile * keyfile; + gchar * identity; + GArray * nicks; }; #define INDICATOR_DESKTOP_SHORTCUTS_GET_PRIVATE(o) \ @@ -63,6 +65,8 @@ indicator_desktop_shortcuts_init (IndicatorDesktopShortcuts *self) IndicatorDesktopShortcutsPrivate * priv = INDICATOR_DESKTOP_SHORTCUTS_GET_PRIVATE(self); priv->keyfile = NULL; + priv->identity = NULL; + priv->nicks = g_array_new(TRUE, TRUE, sizeof(gchar *)); return; } @@ -71,6 +75,13 @@ indicator_desktop_shortcuts_init (IndicatorDesktopShortcuts *self) static void indicator_desktop_shortcuts_dispose (GObject *object) { + IndicatorDesktopShortcutsPrivate * priv = INDICATOR_DESKTOP_SHORTCUTS_GET_PRIVATE(object); + + if (priv->keyfile) { + g_key_file_free(priv->keyfile); + priv->keyfile = NULL; + } + G_OBJECT_CLASS (indicator_desktop_shortcuts_parent_class)->dispose (object); return; @@ -80,6 +91,22 @@ indicator_desktop_shortcuts_dispose (GObject *object) static void indicator_desktop_shortcuts_finalize (GObject *object) { + IndicatorDesktopShortcutsPrivate * priv = INDICATOR_DESKTOP_SHORTCUTS_GET_PRIVATE(object); + + if (priv->identity != NULL) { + g_free(priv->identity); + priv->identity = NULL; + } + + if (priv->nicks != NULL) { + gint i; + for (i = 0; i < priv->nicks->len; i++) { + gchar * nick = g_array_index(priv->nicks, gchar *, i); + g_free(nick); + } + g_array_free(priv->nicks, TRUE); + priv->nicks = NULL; + } G_OBJECT_CLASS (indicator_desktop_shortcuts_parent_class)->finalize (object); return; |