diff options
| author | Dmitry Antipov | 2014-01-28 09:55:06 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2014-01-28 09:55:06 +0400 |
| commit | 6affb4a8073e4ce8d5c94561ce5c4741c869d52e (patch) | |
| tree | 1502330976a105446e0c8948ad21780a938b524d | |
| parent | 0a60cc0dbcfc1d6c12f725038464584c66ca9dfb (diff) | |
| download | emacs-6affb4a8073e4ce8d5c94561ce5c4741c869d52e.tar.gz emacs-6affb4a8073e4ce8d5c94561ce5c4741c869d52e.zip | |
* 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>.
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/terminal.c | 11 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 4fa19d98f7f..fc4ad207993 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2014-01-28 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 2 | |||
| 3 | * terminal.c (initial_free_frame_resources): New function. | ||
| 4 | (init_initial_terminal): Install new hook to free face cache | ||
| 5 | on initial frame and avoid memory leak. For details, see | ||
| 6 | <http://lists.gnu.org/archive/html/emacs-devel/2014-01/msg01974.html>. | ||
| 7 | |||
| 1 | 2014-01-26 Paul Eggert <eggert@cs.ucla.edu> | 8 | 2014-01-26 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 9 | ||
| 3 | * data.c (Fstring_to_number): Document results if unparsable | 10 | * 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). */) | |||
| 500 | return store_terminal_param (t, parameter, value); | 500 | return store_terminal_param (t, parameter, value); |
| 501 | } | 501 | } |
| 502 | 502 | ||
| 503 | 503 | /* Initial frame has no device-dependent output data, but has | |
| 504 | face cache which should be freed when the frame is deleted. */ | ||
| 505 | |||
| 506 | static void | ||
| 507 | initial_free_frame_resources (struct frame *f) | ||
| 508 | { | ||
| 509 | eassert (FRAME_INITIAL_P (f)); | ||
| 510 | free_frame_faces (f); | ||
| 511 | } | ||
| 504 | 512 | ||
| 505 | /* Create the bootstrap display terminal for the initial frame. | 513 | /* Create the bootstrap display terminal for the initial frame. |
| 506 | Returns a terminal of type output_initial. */ | 514 | Returns a terminal of type output_initial. */ |
| @@ -516,6 +524,7 @@ init_initial_terminal (void) | |||
| 516 | initial_terminal->name = xstrdup ("initial_terminal"); | 524 | initial_terminal->name = xstrdup ("initial_terminal"); |
| 517 | initial_terminal->kboard = initial_kboard; | 525 | initial_terminal->kboard = initial_kboard; |
| 518 | initial_terminal->delete_terminal_hook = &delete_initial_terminal; | 526 | initial_terminal->delete_terminal_hook = &delete_initial_terminal; |
| 527 | initial_terminal->delete_frame_hook = &initial_free_frame_resources; | ||
| 519 | /* All other hooks are NULL. */ | 528 | /* All other hooks are NULL. */ |
| 520 | 529 | ||
| 521 | return initial_terminal; | 530 | return initial_terminal; |