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 Created on: 2017-10-24 19:35:49
Submitter: pooryorick Assigned to: nobody
Subsystem: 35. TclOO Package Severity: Important
Priority: 5 Medium Last modified: 2017-11-01 20:25:33
Status: Closed Closed by: pooryorick
Resolution: Fixed Closed on: 2017-11-01 20:25:33
Version:
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.