summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2015-07-02 12:29:43 (GMT)
committerdgp <dgp@users.sourceforge.net>2015-07-02 12:29:43 (GMT)
commit2ee65349c997ec60a0e3def277a24c0f638fed78 (patch)
tree8cf83434ed090e640a4b2611e0ebbdd9314b04d3
parentdfeb9e71446a7354fd0e7551244db75e36bc3c13 (diff)
downloadtcl-2ee65349c997ec60a0e3def277a24c0f638fed78.zip
tcl-2ee65349c997ec60a0e3def277a24c0f638fed78.tar.gz
tcl-2ee65349c997ec60a0e3def277a24c0f638fed78.tar.bz2
Revert some refcount changes on I/O structs.
These are refcounts on structs, not Tcl_Obj's. Their scheme doesn't suffer the same difficulties and histories as Tcl_Obj's, and they need not copy every detail, appropriate or not, from Tcl_Obj refcount management. The "significant value" -- as dkf puts it -- for the struct refcounting scheme is 0 not 1.
-rw-r--r--generic/tclIO.c4
-rw-r--r--generic/tclIOGT.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index eb924d1..8b2e149 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -1930,7 +1930,7 @@ TclChannelRelease(
if (chanPtr->refCount == 0) {
Tcl_Panic("Channel released more than preserved");
}
- if (chanPtr->refCount-- > 1) {
+ if (--chanPtr->refCount) {
return;
}
if (chanPtr->typePtr == NULL) {
@@ -2426,7 +2426,7 @@ static void
ReleaseChannelBuffer(
ChannelBuffer *bufPtr)
{
- if (bufPtr->refCount-- > 1) {
+ if (--bufPtr->refCount) {
return;
}
ckfree(bufPtr);
diff --git a/generic/tclIOGT.c b/generic/tclIOGT.c
index c1ce485..7f61def 100644
--- a/generic/tclIOGT.c
+++ b/generic/tclIOGT.c
@@ -225,7 +225,7 @@ static void
ReleaseData(
TransformChannelData *dataPtr)
{
- if (dataPtr->refCount-- > 1) {
+ if (--dataPtr->refCount) {
return;
}
ResultClear(&dataPtr->result);