Skip to content
Tcl Source Code History Of Ticket 6d4319309e906144
Login

History Of Ticket 6d4319309e906144

Artifacts Associated With Ticket 6d4319309e906144

  1. Ticket change [6a170d507b] (rid 237530) by anonymous on 2025-02-12 22:37:45:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-plain"
    4. comment initialized to:
      When a class is defined in a namespace and it inherits from a class with the same name from a different namespace and an object from the child class is destroyed, the destructor from the parent class does not get invoked.
      
    5. foundin initialized to: "Itcl 4.3.2"
    6. is_private initialized to: "0"
    7. login: "anonymous"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "8a2f9364d2100f10600b2a3fdde9d6d6881f15fa"
    10. resolution initialized to: "None"
    11. severity initialized to: "Important"
    12. status initialized to: "Open"
    13. submitter initialized to: "anonymous"
    14. subsystem initialized to: "10. Objects"
    15. title initialized to:
      Parent-Class destructor not invoked with same class-name in different namespace
      
    16. type initialized to: "Bug"
  2. Add attachment "namespace-class-destructor.tcl" [5bd5390c67] (rid 237531) by anonymous on 2025-02-12 22:40:03.

  3. Ticket change [406af42c23] (rid 237532) by sebres on 2025-02-13 22:06:57:

    1. icomment:
      It seems to be solely Itcl (v.4) issue (thus the correct place for the ticket would be [itcl/ticket](/../itcl/ticket)).
      
      Below enclosed the PoC for tclOO (basis of Itcl since Itcl4), that works as expected:
      
      <details style="padding-left:10pt"><summary>PoC ...</summary>
      
      ```
      namespace eval ::A {}; namespace eval ::B {}
      oo::class create ::A::testCls {
        superclass oo::class
        destructor { puts "bye from ::A::testCls" }
      }
      
      oo::class create ::C::testOtherCls {
        superclass ::A::testCls
        destructor { puts "bye from ::C::testOtherCls"; next }
      }
      oo::class create ::C::testCls {
        superclass ::A::testCls
        destructor { puts "bye from ::C::testCls"; next }
      }
      
      set o [::C::testOtherCls new]
      $o destroy
      puts =================
      set o [::C::testCls new]
      $o destroy
      
      ## results to:
      
      bye from ::C::testOtherCls
      bye from ::A::testCls
      =================
      bye from ::C::testCls
      bye from ::A::testCls
      
      ```
      </details>
      
      Although in tclOO inherited destructor need to be invoked explicitly (using `next`).
      
      I guess, Itcl stores somewhere (hash table?) the chain of destructors by simple name (instead of its reference or fully-qualified name).
      
    2. login: "sebres"
    3. mimetype: "text/x-markdown"
  4. Ticket change [0bc0d86c30] (rid 237618) by sebres on 2025-02-20 13:04:29:

    1. closedate changed to: "2460727.04478788"
    2. closer changed to: "sebres"
    3. icomment:
      Yes, my suspicion about simple name in hash table has been confirmed...<br/>
      Fixed in [[itcl/883c2c383fee7603]](../itcl/vdiff?from=0d99fec557eac487&to=883c2c383fee7603), related ticket [[itcl/987067386fa2edae]](../itcl/info/987067386fa2edae).
      
    4. login: "sebres"
    5. mimetype: "text/x-markdown"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"