[gnome-builder/gnome-builder-3-26] object: hold reference around dispose
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-3-26] object: hold reference around dispose
- Date: Sun, 17 Dec 2017 10:15:27 +0000 (UTC)
commit 41b4a16f7533d8f260842a17e33a7e16ed012c04
Author: Christian Hergert <chergert redhat com>
Date: Sun Dec 17 02:13:30 2017 -0800
object: hold reference around dispose
We need to access private data after chaining up, so ensure we
have a reference to make that safe.
libide/ide-object.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/libide/ide-object.c b/libide/ide-object.c
index 56aeaad..ed24e68 100644
--- a/libide/ide-object.c
+++ b/libide/ide-object.c
@@ -165,6 +165,8 @@ ide_object_dispose (GObject *object)
IdeObject *self = (IdeObject *)object;
IdeObjectPrivate *priv = ide_object_get_instance_private (self);
+ g_object_ref (self);
+
G_OBJECT_CLASS (ide_object_parent_class)->dispose (object);
IDE_TRACE_MSG ("%s (%p)",
@@ -176,6 +178,8 @@ ide_object_dispose (GObject *object)
if (!priv->is_destroyed)
ide_object_destroy (self);
+
+ g_object_unref (self);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]