Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2009-11-23
23:34 • Closed ticket [2857044fff]: freeIntRepProc audit plus 6 other changes artifact: 2da285b92a user: dgp
2009-11-22
00:28 • Ticket [2857044fff]: 4 changes artifact: 5fa1051b91 user: dkf
00:27 • Ticket [2857044fff]: 4 changes artifact: 384e7b92ab user: dkf
2009-11-20
07:20 • Ticket [2857044fff]: 4 changes artifact: 5856605720 user: dgp
2009-09-30
10:11 • Ticket [2857044fff]: 4 changes artifact: bc0321822c user: dgp
2009-09-14
23:43 • Ticket [2857044fff]: 4 changes artifact: 18b3f880e2 user: dgp
15:00 • Ticket [2857044fff]: 4 changes artifact: 2f6f768433 user: nijtmans
2009-09-11
18:22 • New ticket [2857044fff]. artifact: 2d96f4bba0 user: dgp

freeIntRepProc audit

Closed / Fixed2857044fffffffffffffffffffffffffffffffffCreated 17 years agoUpdated 17 years ago
Descriptionplain2009-09-11 18:22:20
Brief discussion on chat concluded that
the freeIntRepProc of any Tcl_ObjType
ought to set the typePtr field to NULL so
that the Tcl_Obj is not left in an inconsistent
state.

At least some freeIntRepProc's in the
core fail to meet this expectation.  Search and destroy.
nijtmansplain2009-09-14 15:00:45
Agreed, but shouln't that be the responsibility of the
TclFreeIntRep macro? Currently, a lot of TclFreeIntRep
calls are followed by setting (objPtr)->typePtr to NULL!
The freeIntRepProc is not supposed to be called directly,
so doing it in TclFreeIntRep has the advantage that
it works for freeIntRep functions outside of the core as well.
dgpplain2009-09-14 23:43:51
Adding it to the TclFreeIntRep macro is
a fine idea too, but can only help the callers
of the macro.  Since the macro is private, the
only callers ought to be within Tcl itself.  For
the sake of extensions, we still need each
freeIntRepProc to do its own housekeeping as
well.

Yes, this is a gap in the interface.  We ought to
have a public routine that plays this role.
dgpplain2009-09-30 10:11:32
Tcl sources updated.  Tk still needs a look.
dgpplain2009-11-20 07:20:39
Thanks for getting the bits I missed in tclEncoding.c.
Just committed the other missed bits in tclVar.c.

Still open for Tk.
dkfplain2009-11-22 00:27:59
All fixed in Tk HEAD. Leaving to dgp to decide whether that means this item should be closed.
dkf Ticket [2857044fff]: 4 changes [History diff]2009-11-22 00:28:00
dgpplain2009-11-23 23:34:39
allow_comments - 1
Log in (anonymous is fine) to add a comment.