[gnome-builder] omnibar: be reusable after calls to dispose
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] omnibar: be reusable after calls to dispose
- Date: Wed, 6 Sep 2017 20:30:11 +0000 (UTC)
commit a45a30d1839993cdf41b47ab1aafae2aaeebcb1b
Author: Christian Hergert <chergert redhat com>
Date: Wed Sep 6 13:29:57 2017 -0700
omnibar: be reusable after calls to dispose
We just want to clear things and then allow the widget to be recycled. So
move the real unrefs to the finalize stage.
libide/workbench/ide-omni-pausable-row.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/libide/workbench/ide-omni-pausable-row.c b/libide/workbench/ide-omni-pausable-row.c
index 6a893b0..ae65bae 100644
--- a/libide/workbench/ide-omni-pausable-row.c
+++ b/libide/workbench/ide-omni-pausable-row.c
@@ -49,10 +49,20 @@ ide_omni_pausable_row_dispose (GObject *object)
{
IdeOmniPausableRow *self = (IdeOmniPausableRow *)object;
+ ide_omni_pausable_row_set_pausable (self, NULL);
+
+ G_OBJECT_CLASS (ide_omni_pausable_row_parent_class)->dispose (object);
+}
+
+static void
+ide_omni_pausable_row_finalize (GObject *object)
+{
+ IdeOmniPausableRow *self = (IdeOmniPausableRow *)object;
+
g_clear_object (&self->group);
g_clear_object (&self->pausable);
- G_OBJECT_CLASS (ide_omni_pausable_row_parent_class)->dispose (object);
+ G_OBJECT_CLASS (ide_omni_pausable_row_parent_class)->finalize (object);
}
static void
@@ -100,6 +110,7 @@ ide_omni_pausable_row_class_init (IdeOmniPausableRowClass *klass)
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
object_class->dispose = ide_omni_pausable_row_dispose;
+ object_class->finalize = ide_omni_pausable_row_finalize;
object_class->get_property = ide_omni_pausable_row_get_property;
object_class->set_property = ide_omni_pausable_row_set_property;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]