diff options
author | dgp <dgp@users.sourceforge.net> | 2015-07-02 12:29:43 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2015-07-02 12:29:43 (GMT) |
commit | 9aa3e851043909a88856222ed97da6ed018a9bbe (patch) | |
tree | 8cf83434ed090e640a4b2611e0ebbdd9314b04d3 /generic | |
parent | fb6b7a8d8df44ad9dc0d96bddf6acfed423fa873 (diff) | |
download | tcl-9aa3e851043909a88856222ed97da6ed018a9bbe.zip tcl-9aa3e851043909a88856222ed97da6ed018a9bbe.tar.gz tcl-9aa3e851043909a88856222ed97da6ed018a9bbe.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.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclIO.c | 4 | ||||
-rw-r--r-- | generic/tclIOGT.c | 2 |
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); |