Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 8773d1d5fd019dbfd5bde9df7ad10744477d6f28
Ticket: 1706140fffffffffffffffffffffffffffffffff
check TclCallVarTraces callers
User & Date: dgp on 2007-05-04 12:15:39
Changes

  1. icomment:
    Logged In: YES 
    user_id=80530
    Originator: YES
    
    
    There's a deeper brokenness
    here that's becoming apparent.
    The value of the TCL_INTERP_DESTROYED
    flag is set once by the caller
    of TclCallVarTraces.  Then TclCallVarTraces
    might well call several traceProcs.
    The first of these might delete the interp,
    so for correct operations, TCL_INTERP_DESTROYED
    ought to get set for subsequent traceProc
    calls.  This implies TclCallVarTraces *should*
    be setting this flag itself, as the only place
    it can be done correctly, and the callers shouldn't
    be burdened with making the attempt.
    
    Looking a bit further it's clear that
    doing this as a flag value passed to
    a traceProc is basically pointless.
    We also pass the interp to traceProc,
    which can just as easily call Tcl_InterpDeleted()
    for itself to check for the deleted interp
    scenario.  We have to support the flag for
    compatibility, but probably should stop
    recommending that traceProcs refer to it
    when they can more simply and reliably just
    call Tcl_InterpDeleted() for themselves.
    
    Ok, did some archeology and the explanation
    is that TCL_INTERP_DESTROYED came first.
    It's there in Tcl 7.4 and who knows how long
    before that.  Tcl_InterpDeleted() didn't show
    up until Tcl 7.5 (3/22/96).
    
    Well, it's well established
    now, and is the better answer.  It's time
    for the TCL_INTERP_DESTROYED flag to just
    fade away.
    
    
  2. login: "dgp"
  3. mimetype: "text/plain"
  4. username: "dgp"