--- vmd-1.8.6/src/TclTextInterp.C.orig 2009-02-02 23:24:27.000000000 +0300 +++ vmd-1.8.6/src/TclTextInterp.C 2009-02-02 23:35:33.000000000 +0300 @@ -100,7 +100,9 @@ TclTextInterp::TclTextInterp(VMDApp *vmdapp) : app(vmdapp) { - +#if 0 + Tcl_InitMemory(interp); // enable Tcl memory debugging features when compiled with TCL_MEM_DEBUG +#endif interp = Tcl_CreateInterp(); commandPtr = Tcl_NewObj(); Tcl_IncrRefCount(commandPtr); @@ -310,8 +312,16 @@ callLevel++; Tcl_RecordAndEvalObj(interp, commandPtr, 0); callLevel--; - +#if TCL_MINOR_VERSION >= 5 + if (Tcl_IsShared(commandPtr)) { + Tcl_DecrRefCount(commandPtr); + commandPtr = Tcl_NewObj(); + Tcl_IncrRefCount(commandPtr); + } +#else +// XXX this crashes Tcl 8.5.[46] with an internal panic Tcl_SetObjLength(commandPtr, 0); +#endif // if ok, send to stdout; if not, send to stderr Tcl_Obj *resultPtr = Tcl_GetObjResult(interp); @@ -388,8 +398,16 @@ if (app->exitFlag) break; Tcl_RecordAndEvalObj(interp, cmdPtr, 0); +#if TCL_MINOR_VERSION >= 5 + if (Tcl_IsShared(cmdPtr)) { + Tcl_DecrRefCount(cmdPtr); + cmdPtr = Tcl_NewObj(); + Tcl_IncrRefCount(cmdPtr); + } +#else + // XXX this crashes Tcl 8.5.[46] with an internal panic Tcl_SetObjLength(cmdPtr, 0); - +#endif // XXX what's this here for? app->display_update();