User: stephent
Date: 06/05/09 12:40:12
Modified: xemacs/src ChangeLog objects-x.c
Log:
Avoid leaking FontStructs. <87lktblbyt.fsf(a)tleepslib.sk.tsukuba.ac.jp>
Revision Changes Path
1.958 +7 -0 XEmacs/xemacs/src/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.957
retrieving revision 1.958
diff -u -p -r1.957 -r1.958
--- ChangeLog 2006/05/08 07:35:23 1.957
+++ ChangeLog 2006/05/09 10:40:07 1.958
@@ -1,3 +1,10 @@
+2006-03-30 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * objects-x.c (x_initialize_font_instance):
+ Ensure that duplicative X font gets freed if we have an Xft font.
+ Remove some redundant debug output.
+ Comment on frequency of calls to this function.
+
2006-05-08 Stephen J. Turnbull <stephen(a)xemacs.org>
* EmacsShell-sub.c (RootGeometryManager):
1.40 +13 -7 XEmacs/xemacs/src/objects-x.c
Index: objects-x.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/objects-x.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -p -r1.39 -r1.40
--- objects-x.c 2006/04/25 14:02:09 1.39
+++ objects-x.c 2006/05/09 10:40:09 1.40
@@ -309,6 +309,12 @@ x_initialize_font_instance (Lisp_Font_In
return 0;
}
+ if (rf && fs)
+ {
+ XFreeFont (dpy, fs);
+ fs = NULL; /* we don' need no steenkin' X font */
+ }
+
if (fs && !fs->max_bounds.width)
{
/* yes, this has been known to happen. */
@@ -316,8 +322,7 @@ x_initialize_font_instance (Lisp_Font_In
fs = NULL;
maybe_signal_error (Qgui_error, "X font is too small", f->name,
Qfont,
errb);
- if (!rf)
- return 0;
+ return 0;
}
/* Now that we're sure that we will succeed, we can allocate data without
@@ -353,11 +358,12 @@ x_initialize_font_instance (Lisp_Font_In
f->height = rf->height;
f->proportional_p = 1; /* we can't recognize monospaced fonts! */
- DEBUG_XFT4 (0, "initialized metrics ascent %d descent %d width %d height
%d\n",
- f->ascent, f->descent, f->width, f->height);
- /* we also output on initialization of any font below */
- DEBUG_XFT1 (2, "initialized Xft font %s\n", XSTRING_DATA(f->name));
- fs = NULL; /* we don' need no steenkin' X font */
+ /* #### This message appears wa-a-ay too often!
+ We probably need to cache truenames or something?
+ Even if Xft does it for us, we cons too many font instances. */
+ DEBUG_XFT4 (0,
+ "initialized metrics ascent %d descent %d width %d height %d\n",
+ f->ascent, f->descent, f->width, f->height);
}
else
{