summaryrefslogtreecommitdiffstats
path: root/generic/tclEncoding.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2016-12-19 18:43:49 (GMT)
committerdgp <dgp@users.sourceforge.net>2016-12-19 18:43:49 (GMT)
commitbc213f0ba3bb7a24f5590a18ac322b79c04a9b99 (patch)
tree21cc1af6c0a01ab9156f161a56346c62ea293c60 /generic/tclEncoding.c
parent1e4644762aef396e8dbaf8585cf0783708a707e3 (diff)
parent972b65b569a076eb77f72d26185a309bcca4ffd4 (diff)
downloadtcl-bc213f0ba3bb7a24f5590a18ac322b79c04a9b99.zip
tcl-bc213f0ba3bb7a24f5590a18ac322b79c04a9b99.tar.gz
tcl-bc213f0ba3bb7a24f5590a18ac322b79c04a9b99.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 507ae5f..e3c986f 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -46,7 +46,7 @@ typedef struct Encoding {
* 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;
@@ -860,11 +860,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);
}