[Xfce4-commits] <ristretto:master> Cleanup image-list object Z
Stephan Arts
noreply at xfce.org
Wed Nov 30 22:36:01 CET 2011
Updating branch refs/heads/master
to 61a7207679d61c38ed28740ae2dd6a2e6b4d7ad8 (commit)
from 8be71e7946b52b0b73e84865d0578b04b428d444 (commit)
commit 61a7207679d61c38ed28740ae2dd6a2e6b4d7ad8
Author: Stephan Arts <stephan at xfce.org>
Date: Wed Nov 30 22:32:28 2011 +0100
Cleanup image-list object
Z
src/main.c | 1 +
src/main_window.c | 9 ++++++---
src/thumbnail_bar.c | 22 ++++++++++++++++++++++
3 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/src/main.c b/src/main.c
index 78009df..d59560f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -167,6 +167,7 @@ main(int argc, char **argv)
}
g_object_unref (settings);
+ g_object_unref (image_list);
xfconf_shutdown();
diff --git a/src/main_window.c b/src/main_window.c
index 2a25027..b564fc4 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -767,9 +767,6 @@ rstto_main_window_class_init(RsttoMainWindowClass *window_class)
widget_class->key_press_event = key_press_event;
}
-
-
-
static void
rstto_main_window_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
{
@@ -799,6 +796,12 @@ rstto_main_window_dispose(GObject *object)
window->priv->settings_manager = NULL;
}
+ if (window->priv->image_list)
+ {
+ g_object_unref (window->priv->image_list);
+ window->priv->image_list = NULL;
+ }
+
G_OBJECT_CLASS (parent_class)->dispose(object);
}
diff --git a/src/thumbnail_bar.c b/src/thumbnail_bar.c
index b1c11f7..18b0b59 100644
--- a/src/thumbnail_bar.c
+++ b/src/thumbnail_bar.c
@@ -62,6 +62,9 @@ static void
rstto_thumbnail_bar_class_init(RsttoThumbnailBarClass *);
static void
+rstto_thumbnail_bar_dispose (GObject *object);
+
+static void
rstto_thumbnail_bar_size_request(GtkWidget *, GtkRequisition *);
static void
rstto_thumbnail_bar_size_allocate(GtkWidget *, GtkAllocation *);
@@ -173,11 +176,15 @@ rstto_thumbnail_bar_class_init(RsttoThumbnailBarClass *bar_class)
GtkWidgetClass *widget_class;
GtkContainerClass *container_class;
+ GObjectClass *object_class = (GObjectClass*)bar_class;
+
widget_class = (GtkWidgetClass*)bar_class;
container_class = (GtkContainerClass*)bar_class;
parent_class = g_type_class_peek_parent(bar_class);
+ object_class->dispose = rstto_thumbnail_bar_dispose;
+
widget_class->size_request = rstto_thumbnail_bar_size_request;
widget_class->size_allocate = rstto_thumbnail_bar_size_allocate;
widget_class->expose_event = rstto_thumbnail_bar_expose;
@@ -205,6 +212,21 @@ rstto_thumbnail_bar_class_init(RsttoThumbnailBarClass *bar_class)
}
+
+static void
+rstto_thumbnail_bar_dispose (GObject *object)
+{
+ RsttoThumbnailBar *bar = RSTTO_THUMBNAIL_BAR (object);
+
+ if (bar->priv->image_list)
+ {
+ g_object_unref (bar->priv->image_list);
+ bar->priv->image_list = NULL;
+ }
+
+ G_OBJECT_CLASS (parent_class)->dispose(object);
+}
+
static void
rstto_thumbnail_bar_size_request(GtkWidget *widget, GtkRequisition *requisition)
{
More information about the Xfce4-commits
mailing list