Fix memleaks; add doc comments.

This commit is contained in:
Daiki Ueno
2011-08-22 16:11:01 +09:00
parent a6bde78168
commit 9d88c1c5da
10 changed files with 142 additions and 34 deletions

View File

@ -239,6 +239,21 @@ client_dispose (GObject *object)
G_OBJECT_CLASS (client_parent_class)->dispose (object);
}
static void
client_finalize (GObject *object)
{
Client *client = CLIENT(object);
if (client->keyboards) {
GSList *next = client->keyboards->next;
/* client->keyboards is a ring; break it before free */
client->keyboards->next = NULL;
g_slist_free (next);
}
G_OBJECT_CLASS (client_parent_class)->finalize (object);
}
static void
client_class_init (ClientClass *klass)
{
@ -248,6 +263,7 @@ client_class_init (ClientClass *klass)
gobject_class->set_property = client_set_property;
gobject_class->get_property = client_get_property;
gobject_class->dispose = client_dispose;
gobject_class->finalize = client_finalize;
pspec = g_param_spec_object ("connection",
"Connection",