Overview
| Artifact ID: | 10996932a3ab4d1821fef288a0e82b2f1622f0db |
|---|---|
| Ticket: | 1904432fffffffffffffffffffffffffffffffff
Tcl_DeleteCommandFromToken and NULL token |
| User & Date: | nobody on 2008-02-29 04:39:31 |
Changes
- assignee changed to: "dkf"
- cmimetype changed to: "text/plain"
- comment changed to:
I create a command with Tcl_CreateObjCommand and register a delete procedure. Creation of the object and deletion of the object work fine. However, if the object is deleted a second time, I get segfaults. The only way for this to happen is if the object's delete procedure is being called, which shouldn't be happening. After the initial call to Tcl_DeleteCommandFromToken, any subsequent call to Tcl_GetCommandFromObj for that object should have returned NULL, and Tcl_DeleteCommandFromToken, being called with a NULL token, should have returned -1. The following code does not work as intended when an attempt is made to delete an object more than once. Tcl_DeleteCommandFromToken(interp, Tcl_GetCommandFromObj(interp, objv[i])); The following code is required for this to work: if ((token = Tcl_GetCommandFromObj(interp, objv[i]))) { Tcl_DeleteCommandFromToken(interp, token); } I believe that the desired result for Tcl_DeleteCommandFromToken, when called with a NULL token, should be to return -1, per the documentation. - foundin changed to: "obsolete: 8.4.17"
- is_private changed to: "0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "18. Commands M-Z"
- title changed to: "Tcl_DeleteCommandFromToken and NULL token"
- type changed to: "RFE"