texinfo-commits
[Top][All Lists]
Advanced

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

[5629] free nodes in history


From: Gavin D. Smith
Subject: [5629] free nodes in history
Date: Sun, 01 Jun 2014 21:33:14 +0000

Revision: 5629
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5629
Author:   gavin
Date:     2014-06-01 21:33:12 +0000 (Sun, 01 Jun 2014)
Log Message:
-----------
free nodes in history

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/info/session.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2014-06-01 21:14:57 UTC (rev 5628)
+++ trunk/ChangeLog     2014-06-01 21:33:12 UTC (rev 5629)
@@ -1,5 +1,12 @@
 2014-06-01  Gavin Smith  <address@hidden>
 
+       * info/session.c (forget_node, forget_windows_and_nodes): Free
+       NODE objects in window history list.
+       (info_split_window): Copy the NODE object when creating a new
+       window.
+
+2014-06-01  Gavin Smith  <address@hidden>
+
        * info/session.c (info_print_node, print_node): print_node merged
        into info_print_node.
 

Modified: trunk/info/session.c
===================================================================
--- trunk/info/session.c        2014-06-01 21:14:57 UTC (rev 5628)
+++ trunk/info/session.c        2014-06-01 21:33:12 UTC (rev 5629)
@@ -342,6 +342,7 @@
   if (i == 0)
     return;
 
+  free (win->hist[i - 1]->node);
   free (win->hist[i - 1]);
   win->hist[i - 1] = 0;
   i = --win->hist_index;
@@ -358,7 +359,10 @@
 {
   int i;
   for (i = 0; i < win->hist_index; i++)
-    free (win->hist[i]);
+    {
+      free (win->hist[i]->node);
+      free (win->hist[i]);
+    }
   free (win->hist);
 }
 
@@ -1277,6 +1281,7 @@
 DECLARE_INFO_COMMAND (info_split_window, _("Split the current window"))
 {
   WINDOW *split, *old_active;
+  NODE *copy;
 #if defined (SPLIT_BEFORE_ACTIVE)
   int pagetop;
 
@@ -1285,16 +1290,16 @@
   pagetop = window->pagetop;
 #endif
   
+  copy = xmalloc (sizeof (NODE));
+  *copy = *window->node; /* Field-by-field copy of structure. */
   /* Make the new window. */
   old_active = active_window;
   active_window = window;
-  split = window_make_window (window->node);
+  split = window_make_window (copy);
   active_window = old_active;
 
   if (!split)
-    {
-      info_error ("%s", msg_win_too_small);
-    }
+    info_error ("%s", msg_win_too_small);
   else
     {
 #if defined (SPLIT_BEFORE_ACTIVE)




reply via email to

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