[gnome-builder] buffer: cleanup disposal
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] buffer: cleanup disposal
- Date: Sun, 18 Jun 2017 09:06:34 +0000 (UTC)
commit 11105290c410746b1cf4c2191567c4fd247ae693
Author: Christian Hergert <chergert redhat com>
Date: Sun Jun 18 02:05:57 2017 -0700
buffer: cleanup disposal
Ensure that we always run the reclaim cycle from dispose.
libide/buffers/ide-buffer.c | 31 ++++++++++++++++++-------------
1 files changed, 18 insertions(+), 13 deletions(-)
---
diff --git a/libide/buffers/ide-buffer.c b/libide/buffers/ide-buffer.c
index 221ad7b..12c860e 100644
--- a/libide/buffers/ide-buffer.c
+++ b/libide/buffers/ide-buffer.c
@@ -1287,6 +1287,19 @@ ide_buffer_dispose (GObject *object)
IDE_ENTRY;
+ if (priv->reclamation_handler != 0)
+ {
+ g_source_remove (priv->reclamation_handler);
+ priv->reclamation_handler = 0;
+ }
+
+ if (priv->context != NULL)
+ {
+ IdeBufferManager *buffer_manager = ide_context_get_buffer_manager (priv->context);
+
+ _ide_buffer_manager_reclaim (buffer_manager, self);
+ }
+
if (priv->check_modified_timeout != 0)
{
g_source_remove (priv->check_modified_timeout);
@@ -1322,14 +1335,6 @@ ide_buffer_dispose (GObject *object)
g_clear_object (&priv->symbol_resolver_adapter);
g_clear_object (&priv->spellchecker);
- if (priv->context != NULL)
- {
- g_object_weak_unref (G_OBJECT (priv->context),
- ide_buffer_release_context,
- self);
- priv->context = NULL;
- }
-
G_OBJECT_CLASS (ide_buffer_parent_class)->dispose (object);
IDE_EXIT;
@@ -1343,14 +1348,14 @@ ide_buffer_finalize (GObject *object)
IDE_ENTRY;
- if (priv->reclamation_handler != 0)
+ if (priv->context != NULL)
{
- g_source_remove (priv->reclamation_handler);
- priv->reclamation_handler = 0;
+ g_object_weak_unref (G_OBJECT (priv->context),
+ ide_buffer_release_context,
+ self);
+ priv->context = NULL;
}
- ide_clear_weak_pointer (&priv->context);
-
G_OBJECT_CLASS (ide_buffer_parent_class)->finalize (object);
DZL_COUNTER_DEC (instances);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]