[PATCH libXft] xftfreetype.c: add XftDestroyFtLibrary().

m.shulhan ms at kilabit.org
Mon Apr 12 05:44:46 PDT 2010


Allow application to release _XftFTlibrary, for cleaning up unused memory.

Signed-off-by: m.shulhan <ms at kilabit.org>
---
 include/X11/Xft/Xft.h.in |    3 +++
 src/xftfreetype.c        |    9 +++++++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/include/X11/Xft/Xft.h.in b/include/X11/Xft/Xft.h.in
index 490945f..72a5c31 100644
--- a/include/X11/Xft/Xft.h.in
+++ b/include/X11/Xft/Xft.h.in
@@ -382,6 +382,9 @@ XftFontClose (Display *dpy, XftFont *pub);
 FcBool
 XftInitFtLibrary(void);
 
+void
+XftDestroyFtLibrary(void);
+
 /* xftglyphs.c */
 void
 XftFontLoadGlyphs (Display	    *dpy,
diff --git a/src/xftfreetype.c b/src/xftfreetype.c
index 7238b82..d830ade 100644
--- a/src/xftfreetype.c
+++ b/src/xftfreetype.c
@@ -1172,3 +1172,12 @@ XftInitFtLibrary (void)
 	return FcFalse;
     return FcTrue;
 }
+
+_X_EXPORT void
+XftDestroyFtLibrary (void)
+{
+    if (_XftFTlibrary) {
+        FT_Done_FreeType (_XftFTlibrary);
+	_XftFTlibrary = NULL;
+    }
+}
-- 
1.6.4.2



More information about the xorg-devel mailing list