summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2022-07-04 15:30:24 -0400
committerThomas E. Dickey <dickey@invisible-island.net>2022-07-06 04:28:09 -0400
commit949295d665b030eb451fa590940293ada84c9bfe (patch)
treeddbbd23e6bd06d3ee59711d41ed7bb20c6e8cccc
parent058d7237068b2a698098c68c171bbbfd04a51b48 (diff)
downloadxorg-lib-libXft-949295d665b030eb451fa590940293ada84c9bfe.tar.gz
fix delinkage of last glyph in font, improve debug-trace
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
-rw-r--r--src/xftglyphs.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/xftglyphs.c b/src/xftglyphs.c
index 8f1c6ac..40b514d 100644
--- a/src/xftglyphs.c
+++ b/src/xftglyphs.c
@@ -785,7 +785,7 @@ XftFontLoadGlyphs (Display *dpy,
xuse->older = glyphindex;
xuse->newer = glyphindex;
if (XftDebug() & XFT_DBG_USAGE)
- printf("alloc %d: %p USE %d.%d\n", glyphindex,
+ printf("alloc %p -> %d: %p USE %d.%d\n", font, glyphindex,
(void *) xuse, xuse->older, xuse->newer);
} else {
XftGlyphUsage *xnew;
@@ -802,8 +802,8 @@ XftFontLoadGlyphs (Display *dpy,
xnew->newer = glyphindex;
xold->older = glyphindex;
if (XftDebug() & XFT_DBG_USAGE)
- printf("alloc %d: %p USE %d.%d, %p NEW %d.%d %p OLD %d.%d\n",
- glyphindex,
+ printf("alloc %p -> %d: %p USE %d.%d, %p NEW %d.%d %p OLD %d.%d\n",
+ font, glyphindex,
(void *) xuse, xuse->older, xuse->newer,
(void *) xnew, xnew->older, xnew->newer,
(void *) xold, xold->older, xold->newer);
@@ -871,9 +871,9 @@ XftFontUnloadGlyphs (Display *dpy,
XftGlyphUsage *xuse = (XftGlyphUsage *) xftg;
XftGlyphUsage *xtmp;
- if (XftDebug() & XFT_DBG_CACHEV)
- printf("free %p USE %d.%d\n",
- (void *) xuse, xuse->older, xuse->newer);
+ if (XftDebug() & XFT_DBG_USAGE)
+ printf("free %p -> %p USE %d.%d\n",
+ font, (void *) xuse, xuse->older, xuse->newer);
if (xuse->older != FT_UINT_MAX) {
xtmp = (XftGlyphUsage *) font->glyphs[xuse->older];
@@ -882,7 +882,10 @@ XftFontUnloadGlyphs (Display *dpy,
xtmp->newer = xuse->newer;
}
if (font->newest == glyphindex) {
- font->newest = xuse->older;
+ if (font->newest == xuse->older)
+ font->newest = FT_UINT_MAX;
+ else
+ font->newest = xuse->older;
}
}
if (xuse->newer != FT_UINT_MAX) {