[gnome-builder] object: ensure reference around dispose call
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] object: ensure reference around dispose call
- Date: Sun, 17 Dec 2017 10:15:44 +0000 (UTC)
commit 26f9224585c312f4f91d1c98971f70e71ecffd40
Author: Christian Hergert <chergert redhat com>
Date: Sun Dec 17 02:11:15 2017 -0800
object: ensure reference around dispose call
We want to access things afterwards, so be defensive to ensure
we have a reference afterwards.
src/libide/ide-object.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/libide/ide-object.c b/src/libide/ide-object.c
index d81299a..43da2db 100644
--- a/src/libide/ide-object.c
+++ b/src/libide/ide-object.c
@@ -199,6 +199,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)",
@@ -210,6 +212,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]