Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 2cd2a0298b2a289f518d94a0da59627531d878b5bc55be137d627e2e7933ef8d
Ticket: 708422a066c634e914c10fdf21bac97f239d602f
unset traces enable calling an object command mid-destruction
User & Date: dkf on 2024-09-16 14:58:29
Changes

  1. icomment:
    This is very tricky. The problem is that once the namespace itself has started to go, lookup of things gets *very very* messy. I'd not thought about using unset traces to put callbacks in at that point; I need to extend the battery of tests for destruction sequences a bit more.
    
    I'm guessing that the resolution will be to make `$self test` fail to dispatch with an error once destruction has advanced that far... but I'm not sure about that. That there will be *some* sort of error is pretty much certain... except it might not be easily observable (or maybe it will if you have the event loop going). Prefer destructors; they get run at a time when things are more reliable. When run via the `destroy` method, they can even report Tcl errors correctly. (The object is still destroyed, but you get a nice error.)
    
    ----
    
    Thank you for reporting this!
    
  2. login: "dkf"
  3. mimetype: "text/x-markdown"