diff options
author | fvogel <fvogelnew1@free.fr> | 2016-11-05 12:04:26 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2016-11-05 12:04:26 (GMT) |
commit | f58782e964943a3a977716bf65ee3b6cedafde06 (patch) | |
tree | d07a21bbd6bd79fea3cdcf68e03c74b63f29d59d /generic/tkFont.c | |
parent | f82b718e135c44bb8bb4865ac5cbb0272502de66 (diff) | |
parent | 2da9e225ec7604a5ad4e4dc46e76d090d733b87c (diff) | |
download | tk-f58782e964943a3a977716bf65ee3b6cedafde06.zip tk-f58782e964943a3a977716bf65ee3b6cedafde06.tar.gz tk-f58782e964943a3a977716bf65ee3b6cedafde06.tar.bz2 |
Close unintended fork
Diffstat (limited to 'generic/tkFont.c')
-rw-r--r-- | generic/tkFont.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/generic/tkFont.c b/generic/tkFont.c index 7f2715b..a00c627 100644 --- a/generic/tkFont.c +++ b/generic/tkFont.c @@ -41,7 +41,7 @@ typedef struct TkFontInfo { */ typedef struct NamedFont { - int refCount; /* Number of users of named font. */ + size_t refCount; /* Number of users of named font. */ int deletePending; /* Non-zero if font should be deleted when * last reference goes away. */ TkFontAttributes fa; /* Desired attributes for named font. */ @@ -1434,8 +1434,7 @@ Tk_FreeFont( */ nfPtr = Tcl_GetHashValue(fontPtr->namedHashPtr); - nfPtr->refCount--; - if ((nfPtr->refCount == 0) && nfPtr->deletePending) { + if ((nfPtr->refCount-- <= 1) && nfPtr->deletePending) { Tcl_DeleteHashEntry(fontPtr->namedHashPtr); ckfree(nfPtr); } |