Issue #76: XFT: Flush `RecentlyUsedFonts` cache when restarting from snapahot jv
authorJan Vrany <jan.vrany@fit.cvut.cz>
Mon, 18 Apr 2016 23:42:35 +0100
branchjv
changeset 7298 6cc9d56cb05d
parent 7297 8061a9b76953
child 7299 009757f02299
Issue #76: XFT: Flush `RecentlyUsedFonts` cache when restarting from snapahot ...in order to correctly recreate fonts. If not flushed, the XftFontDescription>>onDevice:ifAbsent: would find the font in `RecentlyUsedFonts` cache, return it and then subsequent operations would fails since the font has been released. It would ve more correct to remove flushed font from the cache instead of unconditionally slushing all fonts, but since it's a cache, flushing it should not harm and it's significantly faster.
XftFontDescription.st
--- a/XftFontDescription.st	Mon Apr 18 23:37:20 2016 +0100
+++ b/XftFontDescription.st	Mon Apr 18 23:42:35 2016 +0100
@@ -1584,6 +1584,7 @@
     "/ is lost, or a snapshot image is restarted)
     "/ self xftDrawDestroy.
 
+    RecentlyUsedFonts := nil.
     device := nil.
     fontId := nil.
     sharedDrawId := nil.