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",

View File

@ -292,8 +292,8 @@ update_widget (ServerContextService *context)
stage = gtk_clutter_embed_get_stage (GTK_CLUTTER_EMBED(context->widget));
actor = eek_clutter_keyboard_new (context->keyboard);
clutter_actor_set_name (actor, "keyboard");
if (theme)
eek_clutter_keyboard_set_theme (EEK_CLUTTER_KEYBOARD(actor), theme);
eek_clutter_keyboard_set_theme (EEK_CLUTTER_KEYBOARD(actor), theme);
g_object_unref (theme);
clutter_container_add_actor (CLUTTER_CONTAINER(stage), actor);
clutter_stage_set_color (CLUTTER_STAGE(stage), &stage_color);
@ -302,9 +302,8 @@ update_widget (ServerContextService *context)
#endif
} else {
context->widget = eek_gtk_keyboard_new (keyboard);
if (theme)
eek_gtk_keyboard_set_theme (EEK_GTK_KEYBOARD(context->widget),
theme);
eek_gtk_keyboard_set_theme (EEK_GTK_KEYBOARD(context->widget), theme);
g_object_unref (theme);
}
if (!context->window) {