[glide] notebook should ref its stage manager
- From: Robert Carr <racarr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glide] notebook should ref its stage manager
- Date: Thu, 6 May 2010 08:48:47 +0000 (UTC)
commit bdafdc7ab8f02cd04218ff80b18b493256558e30
Author: Robert Carr <racarr Valentine localdomain>
Date: Thu May 6 03:30:53 2010 -0400
notebook should ref its stage manager
libglide/glide-inspector-notebook.c | 17 ++++++++++++++++-
libglide/glide-inspector-slide.c | 3 ++-
2 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/libglide/glide-inspector-notebook.c b/libglide/glide-inspector-notebook.c
index 8ac4452..5298ac8 100644
--- a/libglide/glide-inspector-notebook.c
+++ b/libglide/glide-inspector-notebook.c
@@ -79,7 +79,9 @@ glide_inspector_notebook_selection_changed (GlideStageManager *manager,
static void
glide_inspector_notebook_finalize (GObject *object)
{
+ GlideInspectorNotebook *inspector = GLIDE_INSPECTOR_NOTEBOOK (object);
+ g_object_unref (G_OBJECT (inspector->priv->manager));
}
static void
@@ -190,11 +192,24 @@ void
glide_inspector_notebook_set_stage_manager (GlideInspectorNotebook *inspector,
GlideStageManager *manager)
{
- inspector->priv->manager = manager;
+ int i = 0;
+ GtkNotebook *notebook = GTK_NOTEBOOK (inspector);
+
+ if (inspector->priv->manager)
+ g_object_unref (G_OBJECT (inspector->priv->manager));
+ inspector->priv->manager = (GlideStageManager *)g_object_ref (G_OBJECT (manager));
inspector->priv->selection_changed_id = g_signal_connect (inspector->priv->manager,
"selection-changed",
G_CALLBACK (glide_inspector_notebook_selection_changed),
inspector);
+
+ for (i = 0; i < gtk_notebook_get_n_pages (notebook); i++)
+ {
+ GtkWidget *page = gtk_notebook_get_nth_page (notebook, i);
+ g_object_set (page, "actor", NULL, NULL);
+ }
+
+
g_object_notify (G_OBJECT (inspector), "stage-manager");
}
diff --git a/libglide/glide-inspector-slide.c b/libglide/glide-inspector-slide.c
index ffd1c82..6adca0b 100644
--- a/libglide/glide-inspector-slide.c
+++ b/libglide/glide-inspector-slide.c
@@ -283,8 +283,9 @@ glide_inspector_slide_set_actor (GlideInspectorSlide *inspector,
inspector->priv->color_notify_id);
inspector->priv->color_notify_id = 0;
- g_object_unref (G_OBJECT (inspector->priv->actor));
}
+ if (inspector->priv->actor)
+ g_object_unref (G_OBJECT (inspector->priv->actor));
if (!actor)
return;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]