[gnome-builder] editor-frame: don't leak search string
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] editor-frame: don't leak search string
- Date: Sat, 9 May 2015 19:10:46 +0000 (UTC)
commit a8c68b16c1a5a8708adea5c2dfedb4f4d5526d6c
Author: Christian Hergert <christian hergert me>
Date: Sat May 9 12:08:25 2015 -0700
editor-frame: don't leak search string
src/editor/gb-editor-frame.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/editor/gb-editor-frame.c b/src/editor/gb-editor-frame.c
index 569f343..991c4bc 100644
--- a/src/editor/gb-editor-frame.c
+++ b/src/editor/gb-editor-frame.c
@@ -413,7 +413,9 @@ gb_editor_frame__search_key_press_event (GbEditorFrame *self,
switch (event->keyval)
{
case GDK_KEY_Escape:
- self->previous_search_string = g_strdup (gtk_entry_get_text (GTK_ENTRY (self->search_entry)));
+ /* stash the search string for later */
+ g_free (self->previous_search_string);
+ g_object_get (self->search_entry, "text", &self->previous_search_string, NULL);
ide_source_view_clear_search (self->source_view);
ide_source_view_set_rubberband_search (self->source_view, FALSE);
gtk_widget_grab_focus (GTK_WIDGET (self->source_view));
@@ -691,6 +693,8 @@ gb_editor_frame_dispose (GObject *object)
{
GbEditorFrame *self = (GbEditorFrame *)object;
+ g_clear_pointer (&self->previous_search_string, g_free);
+
ide_clear_weak_pointer (&self->map_animation);
if (self->source_view && self->cursor_moved_handler)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]