Tcl Source Code

View Ticket
Login
Ticket UUID: 9fd5c629c171172ffdc80e29abb2613a7d062da7
Title: TclOO - aborts when a trace on command deletion deletes the object's namespace
Type: Bug Version:
Submitter: pooryorick Created on: 2017-10-24 19:35:49
Subsystem: 35. TclOO Package Assigned To: nobody
Priority: 5 Medium Severity: Important
Status: Closed Last Modified: 2017-11-01 20:25:33
Resolution: Fixed Closed By: pooryorick
    Closed on: 2017-11-01 20:25:33
Description:

The following script causes Tcl to abort:

oo::class create object

trace add command object delete {apply {{name1 name2 action} {
    namespace delete [info object namespace $name1]
}}}

rename object {}

User Comments: pooryorick added on 2017-10-30 05:34:08:

When a trace on the deletion of the command of the object explicitly deletes the namespace of the object, tclOO.c/ObjectNamespaceDeleted() must take care not to clean up the object itself so that tclOO.c/ObjectRenamedTrace() has a valid object pointer to work with.

Fixed in commit bee7f97ad6521604.