summaryrefslogtreecommitdiffstats
path: root/generic/tclPreserve.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2015-07-02 08:17:50 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2015-07-02 08:17:50 (GMT)
commita6e73bdff10969ba7650f19309abf4a6ee9c041d (patch)
tree9b1ff6ff3db457ec452f61ebcb38c942c259dc7d /generic/tclPreserve.c
parent7f2e7b48d83365fd7bb943530df2e43ca61bea8d (diff)
downloadtcl-a6e73bdff10969ba7650f19309abf4a6ee9c041d.zip
tcl-a6e73bdff10969ba7650f19309abf4a6ee9c041d.tar.gz
tcl-a6e73bdff10969ba7650f19309abf4a6ee9c041d.tar.bz2
Another round of refCount consistancy improvements.
Diffstat (limited to 'generic/tclPreserve.c')
-rw-r--r--generic/tclPreserve.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/generic/tclPreserve.c b/generic/tclPreserve.c
index 0bd8f93..0b33d22 100644
--- a/generic/tclPreserve.c
+++ b/generic/tclPreserve.c
@@ -195,7 +195,7 @@ Tcl_Release(
continue;
}
- if (--refPtr->refCount != 0) {
+ if (refPtr->refCount-- > 1) {
Tcl_MutexUnlock(&preserveMutex);
return;
}
@@ -459,8 +459,7 @@ TclHandleRelease(
handlePtr, handlePtr->ptr2, handlePtr->ptr);
}
#endif
- handlePtr->refCount--;
- if ((handlePtr->refCount == 0) && (handlePtr->ptr == NULL)) {
+ if ((handlePtr->refCount-- <= 1) && (handlePtr->ptr == NULL)) {
ckfree(handlePtr);
}
}