From: Dmitry Antipov Date: Tue, 28 Jan 2014 05:55:06 +0000 (+0400) Subject: * terminal.c (initial_free_frame_resources): New function. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~241^2~8 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6affb4a8073e4ce8d5c94561ce5c4741c869d52e;p=emacs.git * 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 . --- diff --git a/src/ChangeLog b/src/ChangeLog index 4fa19d98f7f..fc4ad207993 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2014-01-28 Dmitry Antipov + + * 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 + . + 2014-01-26 Paul Eggert * data.c (Fstring_to_number): Document results if unparsable diff --git a/src/terminal.c b/src/terminal.c index 15e7e8a4474..d0a38b97bb4 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -500,7 +500,15 @@ selected frame's terminal). */) 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 @@ 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;