[gnome-documents] main-view: don't leak the GtkTreeModel
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents] main-view: don't leak the GtkTreeModel
- Date: Thu, 1 Mar 2012 21:08:14 +0000 (UTC)
commit 7129f45ed9ed4d30bf174b34264b0c29a05419a1
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Thu Mar 1 16:05:10 2012 -0500
main-view: don't leak the GtkTreeModel
src/lib/gd-main-view.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/lib/gd-main-view.c b/src/lib/gd-main-view.c
index 6cded5b..3fcd3ed 100644
--- a/src/lib/gd-main-view.c
+++ b/src/lib/gd-main-view.c
@@ -54,6 +54,16 @@ static guint signals[NUM_SIGNALS] = { 0, };
G_DEFINE_TYPE (GdMainView, gd_main_view, GTK_TYPE_SCROLLED_WINDOW)
static void
+gd_main_view_dispose (GObject *obj)
+{
+ GdMainView *self = GD_MAIN_VIEW (obj);
+
+ g_clear_object (&self->priv->model);
+
+ G_OBJECT_CLASS (gd_main_view_parent_class)->dispose (obj);
+}
+
+static void
gd_main_view_init (GdMainView *self)
{
GtkStyleContext *context;
@@ -131,6 +141,7 @@ gd_main_view_class_init (GdMainViewClass *klass)
oclass->get_property = gd_main_view_get_property;
oclass->set_property = gd_main_view_set_property;
+ oclass->dispose = gd_main_view_dispose;
properties[PROP_VIEW_TYPE] =
g_param_spec_int ("view-type",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]