summaryrefslogtreecommitdiffstats
path: root/generic/tclEncoding.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-12-19 09:14:06 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-12-19 09:14:06 (GMT)
commit89f9758279f36f87e7b7efa0c7b2358635a1ea10 (patch)
treefce3b5ded360a863b1c888a8e8fb2c37e5e9ae38 /generic/tclEncoding.c
parentd58a6ddbc39b06ed1a8537870b69e272d06c793c (diff)
parent972b65b569a076eb77f72d26185a309bcca4ffd4 (diff)
downloadtcl-89f9758279f36f87e7b7efa0c7b2358635a1ea10.zip
tcl-89f9758279f36f87e7b7efa0c7b2358635a1ea10.tar.gz
tcl-89f9758279f36f87e7b7efa0c7b2358635a1ea10.tar.bz2
merge trunk
Diffstat (limited to 'generic/tclEncoding.c')
-rw-r--r--generic/tclEncoding.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index d4b6cf1..3dd471d 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -46,7 +46,7 @@ typedef struct {
* nullSize is 2, this is a function that
* returns the number of bytes in a 0x0000
* terminated string. */
- int refCount; /* Number of uses of this structure. */
+ size_t refCount; /* Number of uses of this structure. */
Tcl_HashEntry *hPtr; /* Hash table entry that owns this encoding. */
} Encoding;
@@ -782,11 +782,7 @@ FreeEncoding(
if (encodingPtr == NULL) {
return;
}
- if (encodingPtr->refCount<=0) {
- Tcl_Panic("FreeEncoding: refcount problem !!!");
- }
- encodingPtr->refCount--;
- if (encodingPtr->refCount == 0) {
+ if (encodingPtr->refCount-- <= 1) {
if (encodingPtr->freeProc != NULL) {
encodingPtr->freeProc(encodingPtr->clientData);
}