[glide] Fix crash when deleting slides
- From: Robert Carr <racarr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glide] Fix crash when deleting slides
- Date: Fri, 7 May 2010 16:19:01 +0000 (UTC)
commit a746a0621c9bd1337b0a2acb7c7c40d93d0b1303
Author: Robert Carr <racarr Valentine localdomain>
Date: Fri May 7 12:19:02 2010 -0400
Fix crash when deleting slides
libglide/glide-actor-priv.h | 2 ++
libglide/glide-actor.c | 10 ++++++----
libglide/glide-slide.c | 1 +
libglide/glide-stage-manager.c | 5 +++--
libglide/glide-window.c | 4 ++++
5 files changed, 16 insertions(+), 6 deletions(-)
---
diff --git a/libglide/glide-actor-priv.h b/libglide/glide-actor-priv.h
index ad20775..bce32e4 100644
--- a/libglide/glide-actor-priv.h
+++ b/libglide/glide-actor-priv.h
@@ -29,6 +29,8 @@ struct _GlideActorPrivate
GlideStageManager *manager;
gboolean selected;
+
+ gulong selection_changed_id;
};
G_END_DECLS
diff --git a/libglide/glide-actor.c b/libglide/glide-actor.c
index 8fa5fa7..1243208 100644
--- a/libglide/glide-actor.c
+++ b/libglide/glide-actor.c
@@ -61,7 +61,9 @@ glide_actor_generate_name ()
static void
glide_actor_finalize (GObject *object)
{
- /* Debug? */
+ GlideActor *actor = (GlideActor *)object;
+ if (actor->priv->selection_changed_id)
+ g_signal_handler_disconnect (actor->priv->manager, actor->priv->selection_changed_id);
G_OBJECT_CLASS (glide_actor_parent_class)->finalize (object);
}
@@ -120,9 +122,9 @@ glide_actor_set_stage_manager_real (GlideActor *actor,
g_return_if_fail (actor->priv->manager == NULL || actor->priv->manager == manager);
actor->priv->manager = manager;
- g_signal_connect (actor->priv->manager, "selection-changed",
- G_CALLBACK (glide_actor_selection_changed_callback),
- actor);
+ actor->priv->selection_changed_id = g_signal_connect (actor->priv->manager, "selection-changed",
+ G_CALLBACK (glide_actor_selection_changed_callback),
+ actor);
g_object_notify (G_OBJECT (actor), "stage-manager");
}
diff --git a/libglide/glide-slide.c b/libglide/glide-slide.c
index 839bac6..eef9aef 100644
--- a/libglide/glide-slide.c
+++ b/libglide/glide-slide.c
@@ -434,6 +434,7 @@ glide_slide_dispose (GObject *object)
if (priv->children)
{
+ g_list_foreach (priv->children, (GFunc) clutter_actor_destroy, NULL);
g_list_free (priv->children);
priv->children = NULL;
diff --git a/libglide/glide-stage-manager.c b/libglide/glide-stage-manager.c
index d6bfa8a..98a1acb 100644
--- a/libglide/glide-stage-manager.c
+++ b/libglide/glide-stage-manager.c
@@ -111,6 +111,8 @@ glide_stage_manager_finalize (GObject *object)
if (manager->priv->key_notify_id)
g_signal_handler_disconnect (manager->priv->stage, manager->priv->key_notify_id);
+ if (manager->priv->manip)
+ g_object_unref (G_OBJECT (manager->priv->manip));
g_object_unref (G_OBJECT (manager->priv->document));
G_OBJECT_CLASS (glide_stage_manager_parent_class)->finalize (object);
@@ -201,7 +203,6 @@ glide_stage_manager_add_manipulator (GlideStageManager *manager)
if ((parent = clutter_actor_get_parent (CLUTTER_ACTOR (manip))))
{
clutter_container_remove_actor (CLUTTER_CONTAINER (parent), CLUTTER_ACTOR (manip));
- manip = glide_manipulator_new (NULL);
}
glide_slide_add_actor_content (glide_document_get_nth_slide (manager->priv->document,
@@ -210,7 +211,7 @@ glide_stage_manager_add_manipulator (GlideStageManager *manager)
clutter_actor_hide_all (CLUTTER_ACTOR (manip));
- manager->priv->manip = manip;
+ manager->priv->manip = g_object_ref (G_OBJECT (manip));
}
void
diff --git a/libglide/glide-window.c b/libglide/glide-window.c
index a8558cb..5cae408 100644
--- a/libglide/glide-window.c
+++ b/libglide/glide-window.c
@@ -185,6 +185,8 @@ glide_window_unfullscreen_stage (GlideWindow *w)
glide_document_resize (w->priv->document, w->priv->old_document_width,
w->priv->old_document_height);
+
+
}
static void
@@ -906,6 +908,8 @@ glide_window_fullscreen_stage (GlideWindow *w)
glide_document_get_size (w->priv->document, &w->priv->old_document_width, &w->priv->old_document_height);
glide_document_resize (w->priv->document, gdk_screen_get_height (screen) * 1.3333,
gdk_screen_get_height (screen));
+
+ gtk_widget_grab_focus (w->priv->embed);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]