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

Signed-off-by: m.shulhan <[email protected]>
---
 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

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to