[gtksourceview/wip/search: 29/36] search: avoid reference cycle between buffer and search
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/search: 29/36] search: avoid reference cycle between buffer and search
- Date: Sat, 6 Jul 2013 15:59:09 +0000 (UTC)
commit 27131c69ae58230dcf70648f1d9aec844e2c02cb
Author: Sébastien Wilmet <swilmet gnome org>
Date: Thu Jul 4 21:14:22 2013 +0200
search: avoid reference cycle between buffer and search
The buffer owns a reference to the search, and the search have a pointer
to the buffer, without owning a reference, so there is no reference
cycle.
gtksourceview/gtksourcesearch.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtksourceview/gtksourcesearch.c b/gtksourceview/gtksourcesearch.c
index 71a6bfc..ccb1dfe 100644
--- a/gtksourceview/gtksourcesearch.c
+++ b/gtksourceview/gtksourcesearch.c
@@ -1476,7 +1476,6 @@ set_buffer (GtkSourceSearch *search,
g_assert (search->priv->buffer == NULL);
search->priv->buffer = GTK_TEXT_BUFFER (buffer);
- g_object_ref (buffer);
g_signal_connect_object (buffer,
"insert-text",
@@ -1509,7 +1508,8 @@ _gtk_source_search_dispose (GObject *object)
GtkSourceSearch *search = GTK_SOURCE_SEARCH (object);
clear_search (search);
- g_clear_object (&search->priv->buffer);
+
+ search->priv->buffer = NULL;
G_OBJECT_CLASS (_gtk_source_search_parent_class)->dispose (object);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]