emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r116186: * terminal.c (initial_free_frame_resources)


From: Dmitry Antipov
Subject: [Emacs-diffs] trunk r116186: * terminal.c (initial_free_frame_resources): New function.
Date: Tue, 28 Jan 2014 06:05:33 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116186
revision-id: address@hidden
parent: address@hidden
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Tue 2014-01-28 09:55:06 +0400
message:
  * terminal.c (initial_free_frame_resources): New function.
  (init_initial_terminal): Install new hook to free face cache
  on initial frame and avoid memory leak.  For details, see
  <http://lists.gnu.org/archive/html/emacs-devel/2014-01/msg01974.html>.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/terminal.c                 terminal.c-20091113204419-o5vbwnq5f7feedwu-6118
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-01-26 19:44:23 +0000
+++ b/src/ChangeLog     2014-01-28 05:55:06 +0000
@@ -1,3 +1,10 @@
+2014-01-28  Dmitry Antipov  <address@hidden>
+
+       * terminal.c (initial_free_frame_resources): New function.
+       (init_initial_terminal): Install new hook to free face cache
+       on initial frame and avoid memory leak.  For details, see
+       <http://lists.gnu.org/archive/html/emacs-devel/2014-01/msg01974.html>.
+
 2014-01-26  Paul Eggert  <address@hidden>
 
        * data.c (Fstring_to_number): Document results if unparsable

=== modified file 'src/terminal.c'
--- a/src/terminal.c    2014-01-01 07:43:34 +0000
+++ b/src/terminal.c    2014-01-28 05:55:06 +0000
@@ -500,7 +500,15 @@
   return store_terminal_param (t, parameter, value);
 }
 
-
+/* Initial frame has no device-dependent output data, but has
+   face cache which should be freed when the frame is deleted.  */
+
+static void
+initial_free_frame_resources (struct frame *f)
+{
+  eassert (FRAME_INITIAL_P (f));
+  free_frame_faces (f);
+}
 
 /* Create the bootstrap display terminal for the initial frame.
    Returns a terminal of type output_initial.  */
@@ -516,6 +524,7 @@
   initial_terminal->name = xstrdup ("initial_terminal");
   initial_terminal->kboard = initial_kboard;
   initial_terminal->delete_terminal_hook = &delete_initial_terminal;
+  initial_terminal->delete_frame_hook = &initial_free_frame_resources;
   /* All other hooks are NULL. */
 
   return initial_terminal;


reply via email to

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