4 bt fixes, xft unrefd font fix, add: find in resources, add: user title, filebox...
[goodguy/history.git] / cinelerra-5.1 / guicast / bcwindowbase.C
index db085e863655fc86bc011af6c875b825a7d9d43a..d7440bde39000d7499153dada1e0dbbda26fcb4e 100644 (file)
@@ -182,10 +182,12 @@ BC_WindowBase::~BC_WindowBase()
                for( int i=sizeof(xfont)/sizeof(xfont[0]); --i>=0; )
                        XFreeFont(display, this->*xfont[i]);
 
-// past bug in X caused XRenderExtensionInfo to be damaged
-// if this is done here. left to be done in XCloseDisplay by Xlib.
-// works in more modern systems, and needed for leak testing.
-#if defined(HAVE_XFT) && defined(VALGRIND)
+#ifdef HAVE_XFT
+// prevents a bug when Xft closes with unrefd fonts
+               FcPattern *defaults = FcPatternCreate();
+               FcPatternAddInteger(defaults, "maxunreffonts", 0);
+               XftDefaultSet(display, defaults);
+
                static void *BC_WindowBase::*xft_font[] = {
                         &BC_WindowBase::smallfont_xft,
                         &BC_WindowBase::mediumfont_xft,