Simulator instproc use-scheduler type { $self instvar scheduler_ delete scheduler_ # first delete the existing list scheduler; set scheduler_ [new Scheduler/$type] }
As with the constructor, the object destructor must call the destructor for the parent class explicitly as the very last statement of the destructor. The TclObject destructor will invoke the instance procedure delete-shadow, that in turn invokes the equivalent compiled method../Tcl/Tcl.ccTclClass::delete_shadow to destroy the shadow object. The interpreter itself will destroy the interpreted object.