]> git.eshelyaron.com Git - emacs.git/commitdiff
* terminal.c (initial_free_frame_resources): New function.
authorDmitry Antipov <dmantipov@yandex.ru>
Tue, 28 Jan 2014 05:55:06 +0000 (09:55 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Tue, 28 Jan 2014 05:55:06 +0000 (09:55 +0400)
(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>.

src/ChangeLog
src/terminal.c

index 4fa19d98f7f0ef0db23e5ecf786c4cf2ccc3f742..fc4ad207993e4334bef6e41bf2a1690139c16c4a 100644 (file)
@@ -1,3 +1,10 @@
+2014-01-28  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * 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  <eggert@cs.ucla.edu>
 
        * data.c (Fstring_to_number): Document results if unparsable
index 15e7e8a4474a4f276b25c9fe8ff9ab3a9b336cad..d0a38b97bb44537bff2d93f84cd5ea08cb418bd2 100644 (file)
@@ -500,7 +500,15 @@ selected frame's terminal).  */)
   return store_terminal_param (t, parameter, value);
 }
 
-\f
+/* 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 @@ init_initial_terminal (void)
   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;