Index: generic/xotcl.c =================================================================== diff -u -rb4343163673181630db0867d949d501948ecc746 -r58c2c3096136af10d87e4d2962c3d744a9e383bd --- generic/xotcl.c (.../xotcl.c) (revision b4343163673181630db0867d949d501948ecc746) +++ generic/xotcl.c (.../xotcl.c) (revision 58c2c3096136af10d87e4d2962c3d744a9e383bd) @@ -12368,12 +12368,12 @@ flags = Tcl_Interp_flags(interp); Tcl_Interp_flags(interp) &= ~DELETED; + CallStackPopAll(interp); + if (RUNTIME_STATE(interp)->exitHandlerDestroyRound == XOTCL_EXITHANDLER_OFF) { XOTclFinalizeObjCmd(interp); } - CallStackPopAll(interp); - /* must be before freeing of XOTclGlobalObjects */ XOTclShadowTclCommands(interp, SHADOW_UNLOAD); Index: generic/xotclStack85.c =================================================================== diff -u -r7cb7c751d63fe0eece5756910e3f0b18e61a4d16 -r58c2c3096136af10d87e4d2962c3d744a9e383bd --- generic/xotclStack85.c (.../xotclStack85.c) (revision 7cb7c751d63fe0eece5756910e3f0b18e61a4d16) +++ generic/xotclStack85.c (.../xotclStack85.c) (revision 58c2c3096136af10d87e4d2962c3d744a9e383bd) @@ -286,13 +286,12 @@ Tcl_CallFrame *framePtr = Tcl_Interp_framePtr(interp); if (!framePtr) break; if (Tcl_CallFrame_level(framePtr) == 0) break; -#if 1 + if (Tcl_CallFrame_isProcCallFrame(framePtr) & (FRAME_IS_XOTCL_METHOD|FRAME_IS_XOTCL_CMETHOD)) { /* free the call stack content; we need this just for decr activation count */ XOTclCallStackContent *csc = ((XOTclCallStackContent *)Tcl_CallFrame_clientData(framePtr)); CallStackPop(interp, csc); } -#endif /* pop the Tcl frame */ Tcl_PopCallFrame(interp); }