--- a/XftFontDescription.st Wed Jan 20 02:12:55 2016 +0100
+++ b/XftFontDescription.st Fri Jan 22 20:47:32 2016 +0100
@@ -931,6 +931,7 @@
newFontId := self xftFontOpenPattern: aGraphicsDevice displayId pattern: myPatternId.
newFontId notNil ifTrue:[
"/ Good, this font exists!!
+ myPatternId := nil.
fontId := newFontId.
device := aGraphicsDevice.
aGraphicsDevice registerFont:self.
@@ -1422,7 +1423,7 @@
xftFontMatch: displayId screen: screen pattern: patternId
| error |
-%{
+%{ /* UNLIMITEDSTACK */
#ifdef XFT
XftPattern* p;
XftResult r;
@@ -1457,25 +1458,27 @@
!
xftFontOpenPattern: displayId pattern: patternId
+ "Note: the pattern is destroyed when the font is closed"
+
| error |
%{
#ifdef XFT
XftFont* f;
if ( ! __isExternalAddressLike(displayId) ) {
- error = @symbol(BadArg1);
- goto err;
+ error = @symbol(BadArg1);
+ goto err;
}
if ( ! __isExternalAddressLike(patternId) ) {
- error = @symbol(BadArg2);
- goto err;
+ error = @symbol(BadArg2);
+ goto err;
}
f = XftFontOpenPattern( DISPLAY(displayId) , FC_PATTERN( patternId ) );
if (f == NULL) {
- RETURN ( nil );
+ RETURN ( nil );
} else {
- RETURN ( XFT_FONT_HANDLE_NEW ( f ) );
+ RETURN ( XFT_FONT_HANDLE_NEW ( f ) );
}
err:;
#endif