texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[7804] window_delete_window avoid memory leak


From: gavinsmith0123
Subject: [7804] window_delete_window avoid memory leak
Date: Sat, 20 May 2017 11:51:34 -0400 (EDT)

Revision: 7804
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7804
Author:   gavin
Date:     2017-05-20 11:51:33 -0400 (Sat, 20 May 2017)
Log Message:
-----------
window_delete_window avoid memory leak

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/info/Makefile.am
    trunk/info/window.c

Added Paths:
-----------
    trunk/info/t/close-window-after-search.sh

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2017-05-20 15:47:00 UTC (rev 7803)
+++ trunk/ChangeLog     2017-05-20 15:51:33 UTC (rev 7804)
@@ -1,5 +1,11 @@
 2017-05-20  Gavin Smith  <address@hidden>
 
+       * info/window.c (window_delete_window): Call 'free_matches' and 
+       free 'search_string' field in order to avoid a memory leak.
+       * info/t/close-window-after-search.sh: New test.
+
+2017-05-20  Gavin Smith  <address@hidden>
+
        * info/session.c (info_search_in_node_internal): Call
        free_matches even after a failing search in order to avoid a 
        memory leak.

Modified: trunk/info/Makefile.am
===================================================================
--- trunk/info/Makefile.am      2017-05-20 15:47:00 UTC (rev 7803)
+++ trunk/info/Makefile.am      2017-05-20 15:51:33 UTC (rev 7804)
@@ -148,6 +148,7 @@
        t/replace-viewed.sh \
        t/search-skip-screen.sh \
        t/search-empty.sh \
+       t/close-window-after-search.sh \
        t/inc-sea-forward.sh \
        t/inc-sea-forward-nonregex.sh \
        t/inc-sea-insensitive.sh \

Added: trunk/info/t/close-window-after-search.sh
===================================================================
--- trunk/info/t/close-window-after-search.sh                           (rev 0)
+++ trunk/info/t/close-window-after-search.sh   2017-05-20 15:51:33 UTC (rev 
7804)
@@ -0,0 +1,29 @@
+#!/bin/sh
+# Copyright (C) 2017 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+srcdir=${srcdir:-.}
+. $srcdir/t/Init-test.inc
+. $t/Init-inter.inc
+
+run_ginfo -f intera
+
+# Split window, do a search, and then close the window the search took
+# place in.
+printf '\0302sblah\r\0300q' >$PTY_TYPE
+
+. $t/Timeout-test.inc
+cleanup
+


Property changes on: trunk/info/t/close-window-after-search.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Modified: trunk/info/window.c
===================================================================
--- trunk/info/window.c 2017-05-20 15:47:00 UTC (rev 7803)
+++ trunk/info/window.c 2017-05-20 15:51:33 UTC (rev 7804)
@@ -618,6 +618,8 @@
   free (window->log_line_no);
   free (window->line_map.map);
   free (window->modeline);
+  free_matches (&window->matches);
+  free (window->search_string);
 
   if (window == active_window)
     {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]