[devhelp/wip/stuff: 7/14] sidebar: improve disposing
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devhelp/wip/stuff: 7/14] sidebar: improve disposing
- Date: Tue, 30 Jul 2013 15:14:47 +0000 (UTC)
commit 1f4e77ee4c4a13f1a004038211960a6db2d31311
Author: Ignacio Casal Quinteiro <ignacio casal nice-software com>
Date: Thu Jul 25 10:36:27 2013 +0200
sidebar: improve disposing
src/dh-sidebar.c | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/src/dh-sidebar.c b/src/dh-sidebar.c
index 2b1ec5c..1b10c41 100644
--- a/src/dh-sidebar.c
+++ b/src/dh-sidebar.c
@@ -430,17 +430,26 @@ dh_sidebar_new (DhBookManager *book_manager)
}
static void
-sidebar_finalize (GObject *object)
+dh_sidebar_finalize (GObject *object)
{
DhSidebar *self = DH_SIDEBAR (object);
g_completion_free (self->priv->completion);
- g_object_unref (self->priv->book_manager);
G_OBJECT_CLASS (dh_sidebar_parent_class)->finalize (object);
}
static void
+dh_sidebar_dispose (GObject *object)
+{
+ DhSidebarPrivate *priv = DH_SIDEBAR (object)->priv;
+
+ g_clear_object (&priv->book_manager);
+
+ G_OBJECT_CLASS (dh_sidebar_parent_class)->dispose (object);
+}
+
+static void
dh_sidebar_init (DhSidebar *self)
{
GtkCellRenderer *cell;
@@ -627,7 +636,8 @@ dh_sidebar_class_init (DhSidebarClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- object_class->finalize = sidebar_finalize;
+ object_class->finalize = dh_sidebar_finalize;
+ object_class->dispose = dh_sidebar_dispose;
object_class->get_property = dh_sidebar_get_property;
object_class->set_property = dh_sidebar_set_property;
object_class->constructed = dh_sidebar_constructed;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]