diff options
author | dgp <dgp@users.sourceforge.net> | 2013-11-05 20:58:38 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2013-11-05 20:58:38 (GMT) |
commit | b25cb2a04a6f9760b1704338a1174ff474eed50e (patch) | |
tree | cc0f129c66a0346c3e33394ce452d8f7230f1629 /generic/tkFont.c | |
parent | 77e8ef6b83e8930714f046f37c2871e3689dcfa3 (diff) | |
download | tk-b25cb2a04a6f9760b1704338a1174ff474eed50e.zip tk-b25cb2a04a6f9760b1704338a1174ff474eed50e.tar.gz tk-b25cb2a04a6f9760b1704338a1174ff474eed50e.tar.bz2 |
First draft patch trying to fix [f214b8ad5b].
Diffstat (limited to 'generic/tkFont.c')
-rw-r--r-- | generic/tkFont.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/generic/tkFont.c b/generic/tkFont.c index ad009b9..27cd4af 100644 --- a/generic/tkFont.c +++ b/generic/tkFont.c @@ -421,7 +421,7 @@ TkFontPkgFree( fontsLeft++; #ifdef DEBUG_FONTS fprintf(stderr, "Font %s still in cache.\n", - Tcl_GetHashKey(&fiPtr->fontCache, searchPtr)); + (char *) Tcl_GetHashKey(&fiPtr->fontCache, searchPtr)); #endif } @@ -1093,7 +1093,8 @@ Tk_AllocFontFromObj( int isNew, descent; NamedFont *nfPtr; - if (objPtr->typePtr != &tkFontObjType) { + if (objPtr->typePtr != &tkFontObjType + || objPtr->internalRep.twoPtrValue.ptr2 != &fiPtr->fontCache) { SetFontFromAny(interp, objPtr); } @@ -1133,6 +1134,7 @@ Tk_AllocFontFromObj( fontPtr->resourceRefCount++; fontPtr->objRefCount++; objPtr->internalRep.twoPtrValue.ptr1 = fontPtr; + objPtr->internalRep.twoPtrValue.ptr2 = &fiPtr->fontCache; return (Tk_Font) fontPtr; } } @@ -1243,6 +1245,7 @@ Tk_AllocFontFromObj( } objPtr->internalRep.twoPtrValue.ptr1 = fontPtr; + objPtr->internalRep.twoPtrValue.ptr2 = &fiPtr->fontCache; return (Tk_Font) fontPtr; } @@ -1275,7 +1278,8 @@ Tk_GetFontFromObj( TkFont *fontPtr; Tcl_HashEntry *hashPtr; - if (objPtr->typePtr != &tkFontObjType) { + if (objPtr->typePtr != &tkFontObjType + || objPtr->internalRep.twoPtrValue.ptr2 != &fiPtr->fontCache) { SetFontFromAny(NULL, objPtr); } @@ -1311,6 +1315,7 @@ Tk_GetFontFromObj( if (Tk_Screen(tkwin) == fontPtr->screen) { fontPtr->objRefCount++; objPtr->internalRep.twoPtrValue.ptr1 = fontPtr; + objPtr->internalRep.twoPtrValue.ptr2 = &fiPtr->fontCache; return (Tk_Font) fontPtr; } } @@ -1356,6 +1361,7 @@ SetFontFromAny( } objPtr->typePtr = &tkFontObjType; objPtr->internalRep.twoPtrValue.ptr1 = NULL; + objPtr->internalRep.twoPtrValue.ptr2 = NULL; return TCL_OK; } @@ -1519,6 +1525,7 @@ FreeFontObj( ckfree(fontPtr); } objPtr->internalRep.twoPtrValue.ptr1 = NULL; + objPtr->internalRep.twoPtrValue.ptr2 = NULL; } } @@ -1549,6 +1556,8 @@ DupFontObjProc( dupObjPtr->typePtr = srcObjPtr->typePtr; dupObjPtr->internalRep.twoPtrValue.ptr1 = fontPtr; + dupObjPtr->internalRep.twoPtrValue.ptr2 + = srcObjPtr->internalRep.twoPtrValue.ptr2; if (fontPtr != NULL) { fontPtr->objRefCount++; |