[gnome-builder/gnome-builder-3-28] terminal: don't leak terminal search
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-3-28] terminal: don't leak terminal search
- Date: Mon, 16 Apr 2018 23:52:11 +0000 (UTC)
commit fa43319e18d97cfdf1902f1fb57249711f7b1c55
Author: Christian Hergert <chergert redhat com>
Date: Mon Apr 16 16:51:09 2018 -0700
terminal: don't leak terminal search
This fixes a leak of IdeTerminalSearch that was happening from
improper hierarchy use that got into libide when promoting this
from the terminal plugin.
src/libide/terminal/ide-terminal-search.c | 12 ++++++------
src/libide/terminal/ide-terminal-search.ui | 12 ++++++------
src/plugins/terminal/gb-terminal-view.c | 7 ++++---
3 files changed, 16 insertions(+), 15 deletions(-)
---
diff --git a/src/libide/terminal/ide-terminal-search.c b/src/libide/terminal/ide-terminal-search.c
index 00ea18854..bd46ccb62 100644
--- a/src/libide/terminal/ide-terminal-search.c
+++ b/src/libide/terminal/ide-terminal-search.c
@@ -223,8 +223,8 @@ search_overlay_search_cb (VteTerminal *terminal,
}
static void
-search_revealer_cb (GtkRevealer *search_revealer,
- GParamSpec *pspec G_GNUC_UNUSED,
+search_revealer_cb (GtkRevealer *search_revealer,
+ GParamSpec *pspec,
IdeTerminalSearch *self)
{
g_assert (IDE_IS_TERMINAL_SEARCH (self));
@@ -269,9 +269,9 @@ ide_terminal_search_connect_terminal (IdeTerminalSearch *self)
static void
ide_terminal_search_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
{
IdeTerminalSearch *self = IDE_TERMINAL_SEARCH (object);
@@ -391,7 +391,7 @@ ide_terminal_search_get_regex (IdeTerminalSearch *self)
/**
* ide_terminal_search_get_wrap_around:
* @self: a #IdeTerminalSearch
- *
+ *
*
* Since: 3.28
*/
diff --git a/src/libide/terminal/ide-terminal-search.ui b/src/libide/terminal/ide-terminal-search.ui
index 4b397647d..e349e8927 100644
--- a/src/libide/terminal/ide-terminal-search.ui
+++ b/src/libide/terminal/ide-terminal-search.ui
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <!--template class="IdeTerminalSearch" parent="GtkBin">
- <child-->
+ <template class="IdeTerminalSearch" parent="GtkBin">
+ <property name="halign">end</property>
+ <property name="valign">start</property>
+ <child>
<object class="GtkRevealer" id="search_revealer">
- <property name="halign">end</property>
- <property name="valign">start</property>
<property name="visible">true</property>
<child>
<object class="GtkFrame">
@@ -215,6 +215,6 @@
</object>
</child>
</object>
- <!--/child>
- </template-->
+ </child>
+ </template>
</interface>
diff --git a/src/plugins/terminal/gb-terminal-view.c b/src/plugins/terminal/gb-terminal-view.c
index f239f6606..19be126bb 100644
--- a/src/plugins/terminal/gb-terminal-view.c
+++ b/src/plugins/terminal/gb-terminal-view.c
@@ -575,7 +575,9 @@ gb_terminal_view_init (GbTerminalView *self)
self->run_on_host = TRUE;
self->manage_spawn = TRUE;
- self->tsearch = g_object_new (IDE_TYPE_TERMINAL_SEARCH, NULL);
+ self->tsearch = g_object_new (IDE_TYPE_TERMINAL_SEARCH,
+ "visible", TRUE,
+ NULL);
self->search_revealer_top = ide_terminal_search_get_revealer (self->tsearch);
gtk_widget_init_template (GTK_WIDGET (self));
@@ -584,8 +586,7 @@ gb_terminal_view_init (GbTerminalView *self)
ide_layout_view_set_can_split (IDE_LAYOUT_VIEW (self), TRUE);
ide_layout_view_set_menu_id (IDE_LAYOUT_VIEW (self), "terminal-view-document-menu");
- gtk_overlay_add_overlay (self->terminal_overlay_top,
- GTK_WIDGET (self->search_revealer_top));
+ gtk_overlay_add_overlay (self->terminal_overlay_top, GTK_WIDGET (self->tsearch));
gb_terminal_view_connect_terminal (self, self->terminal_top);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]