Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Documentation for Tcl_DecrRefCount should be changed.

Closed / Fixed218738ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 01:04:46
OriginalBugID: 1952 Bug
Version: 8.1b3
SubmitDate: '1999-04-27'
LastModified: '1999-08-08'
Severity: LOW
Status: Released
Submitter: pat
ChangedBy: hobbs
OS: Other
OSVersion: BSD/OS 4.1
Machine: NA
FixedDate: '1999-08-08'
ClosedDate: '2000-10-25'


Name:
Robert Hare

ReproducibleScript:
The manual pages when refering to Tcl_DecrRefCount all state that the
    object
    is freed when its reference count reaches 0.  They need to be changed to
    read that the object is freed when the reference count is less than or
    equal to zero.
    The macro Tcl_DecrRefCount actually does check for less than or equal.
    This is
    important since code may create a new object and then reach an error
    state 
    prior to incrementing the reference count by calling Tcl_SetObjResult.
    In this
    case the documentation is not clear as to what will happen if
    Tcl_DecrRefCount 
    is called with the reference count being 0.  Will the reference count be
    decremented to -1 and the object's memory lost?  It turns out the
    behavior is
    correct, just the documentation is confusing.



Fixed in 8.2b3 documentation. 
-- 08/08/1999 hobbs
welch Closed ticket [218738ffff]. [History diff]2000-10-26 08:28:12
dgp Ticket [218738ffff]: 3 changes [History diff]2001-04-17 06:05:12
Log in (anonymous is fine) to add a comment.