aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Djärv2003-10-05 12:15:39 +0000
committerJan Djärv2003-10-05 12:15:39 +0000
commit96f09305d6345236220a4c705688c63210b5b890 (patch)
tree91c7b12097efb44c27c6c200739ad7bc00296140 /src
parentc1f0671ae91a1259334de1d4785413a29e63bbff (diff)
downloademacs-96f09305d6345236220a4c705688c63210b5b890.tar.gz
emacs-96f09305d6345236220a4c705688c63210b5b890.zip
Fix memory leaks (from YAMAMOTO Mitsuharu)
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog8
-rw-r--r--src/frame.c2
-rw-r--r--src/xfns.c3
-rw-r--r--src/xterm.c14
4 files changed, 24 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index b38aff206e3..1dfef46a7ce 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,13 @@
12003-10-05 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> 12003-10-05 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2 2
3 * frame.c (Fdelete_frame): Free decode_mode_spec_buffer.
4
5 * xterm.c (x_delete_display): Free font names and font_encoder
6 in dpyinfo->font_table.
7
8 * xfns.c (Fx_close_connection): Only call XFreeFont here. xfree
9 of font names moved to x_delete_display.
10
3 * xterm.h (struct x_display_info): New member, wm_type. 11 * xterm.h (struct x_display_info): New member, wm_type.
4 (struct x_output): New members, expected_top/left and 12 (struct x_output): New members, expected_top/left and
5 check_expected_move. 13 check_expected_move.
diff --git a/src/frame.c b/src/frame.c
index 17952b5ca16..87175e0c6c9 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1279,6 +1279,8 @@ The functions are run with one arg, the frame to be deleted. */)
1279 1279
1280 if (f->namebuf) 1280 if (f->namebuf)
1281 xfree (f->namebuf); 1281 xfree (f->namebuf);
1282 if (f->decode_mode_spec_buffer)
1283 xfree (f->decode_mode_spec_buffer);
1282 if (FRAME_INSERT_COST (f)) 1284 if (FRAME_INSERT_COST (f))
1283 xfree (FRAME_INSERT_COST (f)); 1285 xfree (FRAME_INSERT_COST (f));
1284 if (FRAME_DELETEN_COST (f)) 1286 if (FRAME_DELETEN_COST (f))
diff --git a/src/xfns.c b/src/xfns.c
index 82be739b9d9..ec1500349ea 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -4212,9 +4212,6 @@ If DISPLAY is nil, that stands for the selected frame's display. */)
4212 for (i = 0; i < dpyinfo->n_fonts; i++) 4212 for (i = 0; i < dpyinfo->n_fonts; i++)
4213 if (dpyinfo->font_table[i].name) 4213 if (dpyinfo->font_table[i].name)
4214 { 4214 {
4215 if (dpyinfo->font_table[i].name != dpyinfo->font_table[i].full_name)
4216 xfree (dpyinfo->font_table[i].full_name);
4217 xfree (dpyinfo->font_table[i].name);
4218 XFreeFont (dpyinfo->display, dpyinfo->font_table[i].font); 4215 XFreeFont (dpyinfo->display, dpyinfo->font_table[i].font);
4219 } 4216 }
4220 4217
diff --git a/src/xterm.c b/src/xterm.c
index 9189d6a0d2a..c563757e63b 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -10649,6 +10649,8 @@ void
10649x_delete_display (dpyinfo) 10649x_delete_display (dpyinfo)
10650 struct x_display_info *dpyinfo; 10650 struct x_display_info *dpyinfo;
10651{ 10651{
10652 int i;
10653
10652 delete_keyboard_wait_descriptor (dpyinfo->connection); 10654 delete_keyboard_wait_descriptor (dpyinfo->connection);
10653 10655
10654 /* Discard this display from x_display_name_list and x_display_list. 10656 /* Discard this display from x_display_name_list and x_display_list.
@@ -10700,6 +10702,18 @@ x_delete_display (dpyinfo)
10700 xim_close_dpy (dpyinfo); 10702 xim_close_dpy (dpyinfo);
10701#endif 10703#endif
10702 10704
10705 /* Free the font names in the font table. */
10706 for (i = 0; i < dpyinfo->n_fonts; i++)
10707 if (dpyinfo->font_table[i].name)
10708 {
10709 if (dpyinfo->font_table[i].name != dpyinfo->font_table[i].full_name)
10710 xfree (dpyinfo->font_table[i].full_name);
10711 xfree (dpyinfo->font_table[i].name);
10712 }
10713
10714 if (dpyinfo->font_table->font_encoder)
10715 xfree (dpyinfo->font_table->font_encoder);
10716
10703 xfree (dpyinfo->font_table); 10717 xfree (dpyinfo->font_table);
10704 xfree (dpyinfo->x_id_name); 10718 xfree (dpyinfo->x_id_name);
10705 xfree (dpyinfo->color_cells); 10719 xfree (dpyinfo->color_cells);