aboutsummaryrefslogtreecommitdiff
path: root/tests/dummy-indicator-signaler.c
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2012-02-03 15:34:07 +0100
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2012-02-03 15:34:07 +0100
commit7ae413b583259eb8c312511c4da5f0558d2daab9 (patch)
treec09cf61764bd35f41fd476a53619a0e913c50f49 /tests/dummy-indicator-signaler.c
parentc87aff749b07f228e3fa69c1155d9128ef07620c (diff)
downloadlibayatana-indicator-7ae413b583259eb8c312511c4da5f0558d2daab9.tar.gz
libayatana-indicator-7ae413b583259eb8c312511c4da5f0558d2daab9.tar.bz2
libayatana-indicator-7ae413b583259eb8c312511c4da5f0558d2daab9.zip
tests, DummyIndicatorSignaler: free the allocated memory.
Diffstat (limited to 'tests/dummy-indicator-signaler.c')
-rw-r--r--tests/dummy-indicator-signaler.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/dummy-indicator-signaler.c b/tests/dummy-indicator-signaler.c
index 9908d3d..a4206d0 100644
--- a/tests/dummy-indicator-signaler.c
+++ b/tests/dummy-indicator-signaler.c
@@ -42,6 +42,7 @@ struct _DummyIndicatorSignalerClass {
struct _DummyIndicatorSignaler {
IndicatorObject parent;
+ IndicatorObjectEntry *entries;
};
GType dummy_indicator_signaler_get_type (void);
@@ -111,11 +112,10 @@ idle_signal (gpointer data)
DummyIndicatorSignaler * self = DUMMY_INDICATOR_SIGNALER(data);
IndicatorObjectEntry *added_entry, *removed_entry, *moved_entry;
- IndicatorObjectEntry *entries = g_new0(IndicatorObjectEntry, 3);
- added_entry = &entries[0];
- moved_entry = &entries[1];
- removed_entry = &entries[2];
+ added_entry = &self->entries[0];
+ moved_entry = &self->entries[1];
+ removed_entry = &self->entries[2];
added_entry->name_hint = "added";
moved_entry->name_hint = "moved";
@@ -131,6 +131,7 @@ idle_signal (gpointer data)
static void
dummy_indicator_signaler_init (DummyIndicatorSignaler *self)
{
+ self->entries = g_new0(IndicatorObjectEntry, 3);
g_idle_add(idle_signal, self);
return;
}
@@ -146,7 +147,8 @@ dummy_indicator_signaler_dispose (GObject *object)
static void
dummy_indicator_signaler_finalize (GObject *object)
{
-
+ DummyIndicatorSignaler * self = DUMMY_INDICATOR_SIGNALER(object);
+ g_free (self->entries);
G_OBJECT_CLASS (dummy_indicator_signaler_parent_class)->finalize (object);
return;
}