User: james
Date: 06/06/28 00:59:45
Modified: xemacs/src ChangeLog redisplay-gtk.c redisplay-msw.c
redisplay-output.c redisplay-tty.c redisplay-x.c
Log:
Don't leak Dynarr's in redisplay. <m3sllwwxja.fsf(a)jerrypc.cs.usu.edu>
Revision Changes Path
1.980 +9 -0 XEmacs/xemacs/src/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.979
retrieving revision 1.980
diff -u -p -r1.979 -r1.980
--- ChangeLog 2006/06/23 15:44:59 1.979
+++ ChangeLog 2006/06/27 22:59:37 1.980
@@ -1,3 +1,12 @@
+2006-06-22 Jerry James <james(a)xemacs.org>
+
+ * redisplay-gtk.c (gtk_output_display_block): Fix a Dynarr leak.
+ Don't create the buffer if there is nothing to do.
+ * redisplay-msw.c (mswindows_output_display_block): Ditto.
+ * redisplay-output.c (redisplay_output_layout): Ditto.
+ * redisplay-tty.c (tty_output_display_block): Ditto.
+ * redisplay-x.c (x_output_display_block): Ditto.
+
2006-06-23 Stephen J. Turnbull <stephen(a)xemacs.org>
* font-mgr.c (extract_fcapi_string):
1.19 +2 -2 XEmacs/xemacs/src/redisplay-gtk.c
Index: redisplay-gtk.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/redisplay-gtk.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -p -r1.18 -r1.19
--- redisplay-gtk.c 2005/11/22 11:24:45 1.18
+++ redisplay-gtk.c 2006/06/27 22:59:39 1.19
@@ -293,7 +293,7 @@ gtk_output_display_block (struct window
int cursor_width, int cursor_height)
{
struct frame *f = XFRAME (w->frame);
- Ichar_dynarr *buf = Dynarr_new (Ichar);
+ Ichar_dynarr *buf;
Lisp_Object window;
struct display_block *db = Dynarr_atp (dl->display_blocks, block);
@@ -325,7 +325,7 @@ gtk_output_display_block (struct window
if (end < 0)
end = Dynarr_length (rba);
- Dynarr_reset (buf);
+ buf = Dynarr_new (Ichar);
while (elt < end)
{
1.43 +2 -2 XEmacs/xemacs/src/redisplay-msw.c
Index: redisplay-msw.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/redisplay-msw.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -p -r1.42 -r1.43
--- redisplay-msw.c 2005/01/24 23:34:07 1.42
+++ redisplay-msw.c 2006/06/27 22:59:39 1.43
@@ -907,7 +907,7 @@ mswindows_output_display_block (struct w
int cursor_width, int cursor_height)
{
struct frame *f = XFRAME (w->frame);
- Ichar_dynarr *buf = Dynarr_new (Ichar);
+ Ichar_dynarr *buf;
Lisp_Object window;
struct display_block *db = Dynarr_atp (dl->display_blocks, block);
@@ -934,7 +934,7 @@ mswindows_output_display_block (struct w
if (end < 0)
end = Dynarr_length (rba);
- Dynarr_reset (buf);
+ buf = Dynarr_new (Ichar);
while (elt < end)
{
1.27 +3 -1 XEmacs/xemacs/src/redisplay-output.c
Index: redisplay-output.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/redisplay-output.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -p -r1.26 -r1.27
--- redisplay-output.c 2005/01/24 23:34:07 1.26
+++ redisplay-output.c 2006/06/27 22:59:40 1.27
@@ -1407,7 +1407,7 @@ redisplay_output_layout (Lisp_Object dom
{
Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance);
Lisp_Object rest, window = DOMAIN_WINDOW (domain);
- Ichar_dynarr *buf = Dynarr_new (Ichar);
+ Ichar_dynarr *buf;
struct window *w = XWINDOW (window);
struct device *d = DOMAIN_XDEVICE (domain);
int layout_height, layout_width;
@@ -1423,6 +1423,8 @@ redisplay_output_layout (Lisp_Object dom
/* This makes the glyph area fit into the display area. */
if (!redisplay_normalize_glyph_area (db, dga))
return;
+
+ buf = Dynarr_new (Ichar);
/* Highly dodgy optimization. We want to only output the whole
layout if we really have to. */
1.26 +2 -2 XEmacs/xemacs/src/redisplay-tty.c
Index: redisplay-tty.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/redisplay-tty.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -p -r1.25 -r1.26
--- redisplay-tty.c 2005/01/24 23:34:07 1.25
+++ redisplay-tty.c 2006/06/27 22:59:40 1.26
@@ -206,7 +206,7 @@ tty_output_display_block (struct window
int UNUSED (cursor_height))
{
struct frame *f = XFRAME (w->frame);
- Ichar_dynarr *buf = Dynarr_new (Ichar);
+ Ichar_dynarr *buf;
struct display_block *db = Dynarr_atp (dl->display_blocks, block);
rune_dynarr *rba = db->runes;
@@ -232,7 +232,7 @@ tty_output_display_block (struct window
if (end < 0)
end = Dynarr_length (rba);
- Dynarr_reset (buf);
+ buf = Dynarr_new (Ichar);
while (elt < end && Dynarr_atp (rba, elt)->xpos < start_pixpos)
{
1.43 +2 -2 XEmacs/xemacs/src/redisplay-x.c
Index: redisplay-x.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/redisplay-x.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -p -r1.42 -r1.43
--- redisplay-x.c 2006/06/03 17:50:55 1.42
+++ redisplay-x.c 2006/06/27 22:59:40 1.43
@@ -432,7 +432,7 @@ x_output_display_block (struct window *w
#ifndef USE_XFT
struct frame *f = XFRAME (w->frame);
#endif
- Ichar_dynarr *buf = Dynarr_new (Ichar);
+ Ichar_dynarr *buf;
Lisp_Object window;
struct display_block *db = Dynarr_atp (dl->display_blocks, block);
@@ -459,7 +459,7 @@ x_output_display_block (struct window *w
if (end < 0)
end = Dynarr_length (rba);
- Dynarr_reset (buf);
+ buf = Dynarr_new (Ichar);
while (elt < end)
{