Index: configure =================================================================== diff -u -r5a1a793f1883f3e87cdc80bfabf819a45cb0ac62 -r5ec6a6f960964d861d68c052d8e2e7d68b711449 --- configure (.../configure) (revision 5a1a793f1883f3e87cdc80bfabf819a45cb0ac62) +++ configure (.../configure) (revision 5ec6a6f960964d861d68c052d8e2e7d68b711449) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for xotcl 2.0.0a. +# Generated by GNU Autoconf 2.61 for xotcl 2.0.0. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. @@ -572,8 +572,8 @@ # Identity of this package. PACKAGE_NAME='xotcl' PACKAGE_TARNAME='xotcl' -PACKAGE_VERSION='2.0.0a' -PACKAGE_STRING='xotcl 2.0.0a' +PACKAGE_VERSION='2.0.0' +PACKAGE_STRING='xotcl 2.0.0' PACKAGE_BUGREPORT='' # Factoring default headers for most tests. @@ -1276,7 +1276,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures xotcl 2.0.0a to adapt to many kinds of systems. +\`configure' configures xotcl 2.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1337,7 +1337,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xotcl 2.0.0a:";; + short | recursive ) echo "Configuration of xotcl 2.0.0:";; esac cat <<\_ACEOF @@ -1448,7 +1448,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -xotcl configure 2.0.0a +xotcl configure 2.0.0 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1462,7 +1462,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by xotcl $as_me 2.0.0a, which was +It was created by xotcl $as_me 2.0.0, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2066,7 +2066,7 @@ # do not modify the following lines manually, they are generated with changeXOTclVersion XOTCL_MAJOR_VERSION=2 XOTCL_MINOR_VERSION=0 -XOTCL_RELEASE_LEVEL=.0a +XOTCL_RELEASE_LEVEL=.0 XOTCL_VERSION=${XOTCL_MAJOR_VERSION}.${XOTCL_MINOR_VERSION} NODOT_VERSION=${XOTCL_MAJOR_VERSION}${XOTCL_MINOR_VERSION} @@ -11012,7 +11012,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by xotcl $as_me 2.0.0a, which was +This file was extended by xotcl $as_me 2.0.0, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -11055,7 +11055,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -xotcl config.status 2.0.0a +xotcl config.status 2.0.0 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" @@ -11808,3 +11808,5 @@ + + Index: configure.in =================================================================== diff -u -r5a1a793f1883f3e87cdc80bfabf819a45cb0ac62 -r5ec6a6f960964d861d68c052d8e2e7d68b711449 --- configure.in (.../configure.in) (revision 5a1a793f1883f3e87cdc80bfabf819a45cb0ac62) +++ configure.in (.../configure.in) (revision 5ec6a6f960964d861d68c052d8e2e7d68b711449) @@ -11,7 +11,7 @@ # for this package, and can be a relative path, such as: # #-------------------------------------------------------------------- -define(XOTclVersion, 2.0.0a) +define(XOTclVersion, 2.0.0) AC_INIT([xotcl], [XOTclVersion]) #-------------------------------------------------------------------- @@ -104,7 +104,7 @@ # do not modify the following lines manually, they are generated with changeXOTclVersion XOTCL_MAJOR_VERSION=2 XOTCL_MINOR_VERSION=0 -XOTCL_RELEASE_LEVEL=.0a +XOTCL_RELEASE_LEVEL=.0 XOTCL_VERSION=${XOTCL_MAJOR_VERSION}.${XOTCL_MINOR_VERSION} NODOT_VERSION=${XOTCL_MAJOR_VERSION}${XOTCL_MINOR_VERSION} @@ -520,3 +520,5 @@ + + Index: generic/xotcl.c =================================================================== diff -u -r8e5a1351ecc12dfca1e3988240a07fa745439d42 -r5ec6a6f960964d861d68c052d8e2e7d68b711449 --- generic/xotcl.c (.../xotcl.c) (revision 8e5a1351ecc12dfca1e3988240a07fa745439d42) +++ generic/xotcl.c (.../xotcl.c) (revision 5ec6a6f960964d861d68c052d8e2e7d68b711449) @@ -1845,7 +1845,7 @@ if (callDestroyMethod((ClientData)obj, interp, obj, 0) != TCL_OK) { /* destroy method failed, but we have to remove the command anyway. */ - obj->flags |= XOTCL_DESTROY_CALLED; + /*obj->flags |= XOTCL_DESTROY_CALLED;*/ if (obj->teardown) { CallStackDestroyObject(interp, obj); @@ -2349,7 +2349,14 @@ if (obj->teardown && oid) { Tcl_Obj *savedObjResult = Tcl_GetObjResult(interp); INCR_REF_COUNT(savedObjResult); + Tcl_DeleteCommandFromToken(interp, oid); /* this can change the result */ +#if !defined(OLD_DELETE) + if (XOTclObjectIsClass(obj)) + PrimitiveCDestroy((ClientData) obj); + else + PrimitiveODestroy((ClientData) obj); +#endif Tcl_SetObjResult(interp, savedObjResult); DECR_REF_COUNT(savedObjResult); } @@ -2359,6 +2366,12 @@ CallStackDestroyObject(Tcl_Interp *interp, XOTclObject *obj) { int marked = CallStackMarkDestroyed(interp, obj); +#ifdef OBJDELETION_TRACE + fprintf(stderr, " CallStackDestroyObject %s marked %d\n", objectName(obj), marked); +#endif + + obj->flags |= XOTCL_DESTROY_CALLED; + /* if the object is not referenced on the callstack anymore we have to destroy it directly, because CallStackPop won't find the object destroy */ @@ -5116,6 +5129,7 @@ XOTclCallStackContent *csc) { XOTclRuntimeState *rst = RUNTIME_STATE(interp); int result; + XOTclObjectOpt *opt = obj->opt; #if defined(PRE85) XOTcl_FrameDecls; #endif @@ -5172,8 +5186,7 @@ } } - if (obj->opt && - (obj->opt->checkoptions & CHECK_PRE) && + if (opt && (opt->checkoptions & CHECK_PRE) && (result = AssertionCheck(interp, obj, cl, methodName, CHECK_PRE)) == TCL_ERROR) { goto finish; } @@ -5272,8 +5285,8 @@ methodName);*/ } - if (obj->opt && /*!rst->callIsDestroy &&*/ obj->teardown && - (obj->opt->checkoptions & CHECK_POST)) { + if (opt && !rst->callIsDestroy && obj->teardown && + (opt->checkoptions & CHECK_POST)) { result = AssertionCheck(interp, obj, cl, methodName, CHECK_POST); } @@ -7335,6 +7348,28 @@ obj->cmdName ? objectName(obj) : "", obj, obj->cl);*/ } +static void +tclDeletesObject(ClientData clientData) { + XOTclObject *obj = (XOTclObject*)clientData; + Tcl_Interp *interp; +#if defined(OLD_DELETE) + if (XOTclObjectIsClass(obj)) + PrimitiveCDestroy((ClientData) obj); + else + PrimitiveODestroy((ClientData) obj); +#else +# ifdef OBJDELETION_TRACE + fprintf(stderr,"tclDeletesObject %p\n",obj); +# endif + if (!obj || !obj->teardown) return; + interp = obj->teardown; +# ifdef OBJDELETION_TRACE + fprintf(stderr,"... %p %s\n",obj,objectName(obj)); +# endif + CallStackDestroyObject(interp,obj); +#endif +} + /* * physical object destroy */ @@ -7471,7 +7506,7 @@ return 0; } obj->id = Tcl_CreateObjCommand(interp, name, XOTclObjDispatch, - (ClientData)obj, PrimitiveODestroy); + (ClientData)obj, tclDeletesObject); PrimitiveOInit(obj, interp, name, cl); #if defined(KEEP_TCL_CMD_TYPE) @@ -7867,7 +7902,7 @@ return 0; } obj->id = Tcl_CreateObjCommand(interp, name, XOTclObjDispatch, - (ClientData)cl, PrimitiveCDestroy); + (ClientData)cl, tclDeletesObject); PrimitiveOInit(obj, interp, name, class); @@ -8678,15 +8713,15 @@ } else if (c == 'a' && !strncmp(element,"argcl", 4)) { if (Tcl_ListObjIndex(interp, o, 1, &list) != TCL_OK) { return XOTclVarErrMsg(interp, "forward: %argclindex must by a valid list, given: '", - ObjStr(o), "'", (char *) NULL); + element, "'", (char *) NULL); } if (Tcl_ListObjGetElements(interp, list, &nrElements, &listElements) != TCL_OK) { return XOTclVarErrMsg(interp, "forward: %argclindex contains invalid list '", ObjStr(list),"'", (char *) NULL); } if (nrargs >= nrElements) { return XOTclVarErrMsg(interp, "forward: not enough elements in specified list of ARGC argument ", - ObjStr(o), (char *) NULL); + element, (char *) NULL); } *out = listElements[nrargs]; } else if (c == '%') { @@ -8728,6 +8763,7 @@ callForwarder(forwardCmdClientData *tcd, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ClientData clientData; int result; + XOTclObject *obj = tcd->obj; XOTcl_FrameDecls; if (tcd->verbose) { @@ -8736,7 +8772,7 @@ DECR_REF_COUNT(cmd); } if (tcd->objscope) { - XOTcl_PushFrame(interp, tcd->obj); + XOTcl_PushFrame(interp, obj); } if (tcd->objProc) { result = (tcd->objProc)(tcd->clientData, interp, objc, objv); @@ -8750,7 +8786,7 @@ } if (tcd->objscope) { - XOTcl_PopFrame(interp, tcd->obj); + XOTcl_PopFrame(interp, obj); } if (result == TCL_ERROR && tcd && tcd->onerror) { Tcl_Obj *ov[2]; @@ -10990,7 +11026,7 @@ /* * latch, and call delete command if not already in progress */ - delobj->flags |= XOTCL_DESTROY_CALLED; + /*delobj->flags |= XOTCL_DESTROY_CALLED;*/ RUNTIME_STATE(interp)->callIsDestroy = 1; /*fprintf(stderr,"dealloc %s : setting callIsDestroy = 1\n", ObjStr(object);*/ if (RUNTIME_STATE(interp)->exitHandlerDestroyRound != Index: generic/xotcl.h =================================================================== diff -u -rdc6c71950983c8fc6c220a751e3e0e3f79b5e10b -r5ec6a6f960964d861d68c052d8e2e7d68b711449 --- generic/xotcl.h (.../xotcl.h) (revision dc6c71950983c8fc6c220a751e3e0e3f79b5e10b) +++ generic/xotcl.h (.../xotcl.h) (revision 5ec6a6f960964d861d68c052d8e2e7d68b711449) @@ -83,6 +83,10 @@ */ /* +#define OBJDELETION_TRACE 1 +*/ +#define OLD_DELETE +/* #define TCL85STACK_TRACE 1 #define TCL85STACK 1 #define CANONICAL_ARGS 1 Index: generic/xotclInt.h =================================================================== diff -u -r4c6a52f970030c4f59fdc97273e41febe5b3eb13 -r5ec6a6f960964d861d68c052d8e2e7d68b711449 --- generic/xotclInt.h (.../xotclInt.h) (revision 4c6a52f970030c4f59fdc97273e41febe5b3eb13) +++ generic/xotclInt.h (.../xotclInt.h) (revision 5ec6a6f960964d861d68c052d8e2e7d68b711449) @@ -259,26 +259,24 @@ /*fprintf(stderr,"XOTcl_PushFrame frame %p\n",framePtr);*/ \ Tcl_PushCallFrame(interp, (Tcl_CallFrame*)framePtr, (obj)->nsPtr, 0|FRAME_IS_XOTCL_OBJECT); \ } else { \ - CallFrame *myframePtr = (CallFrame *)framePtr; \ /*fprintf(stderr,"XOTcl_PushFrame frame %p (with fakeNS)\n",framePtr);*/ \ Tcl_PushCallFrame(interp, (Tcl_CallFrame*)framePtr, Tcl_CallFrame_nsPtr(Tcl_Interp_varFramePtr(interp)), 1|FRAME_IS_XOTCL_OBJECT); \ - Tcl_CallFrame_procPtr(myframePtr) = &RUNTIME_STATE(interp)->fakeProc; \ - Tcl_CallFrame_varTablePtr(myframePtr) = (obj)->varTable; \ + Tcl_CallFrame_procPtr(framePtr) = &RUNTIME_STATE(interp)->fakeProc; \ + Tcl_CallFrame_varTablePtr(framePtr) = (obj)->varTable; \ } \ XOTcl_PushFrameSetCd(obj) #define XOTcl_PushFrameCsc(interp,obj,csc) \ - /*fprintf(stderr,"PUSH OBJECT_FRAME (XOTcl_PushFrame) frame %p\n",framePtr); */ \ + /*fprintf(stderr,"PUSH CMETHOD_FRAME (XOTcl_PushFrame) frame %p\n",framePtr); */ \ if ((obj)->nsPtr) { \ frame_constructed = 0; \ /*fprintf(stderr,"XOTcl_PushFrame frame %p\n",framePtr);*/ \ Tcl_PushCallFrame(interp, (Tcl_CallFrame*)framePtr, (obj)->nsPtr, 0|FRAME_IS_XOTCL_CMETHOD); \ } else { \ - CallFrame *myframePtr = (CallFrame *)framePtr; \ /*fprintf(stderr,"XOTcl_PushFrame frame %p (with fakeNS)\n",framePtr);*/ \ Tcl_PushCallFrame(interp, (Tcl_CallFrame*)framePtr, Tcl_CallFrame_nsPtr(Tcl_Interp_varFramePtr(interp)), 1|FRAME_IS_XOTCL_CMETHOD); \ - Tcl_CallFrame_procPtr(myframePtr) = &RUNTIME_STATE(interp)->fakeProc; \ - Tcl_CallFrame_varTablePtr(myframePtr) = (obj)->varTable; \ + Tcl_CallFrame_procPtr(framePtr) = &RUNTIME_STATE(interp)->fakeProc; \ + Tcl_CallFrame_varTablePtr(framePtr) = (obj)->varTable; \ } \ XOTcl_PushFrameSetCd(csc) @@ -293,6 +291,13 @@ /*fprintf(stderr,"POP OBJECT_FRAME (XOTcl_PopFrame) frame %p\n",framePtr); */ \ Tcl_PopCallFrame(interp) +#if 0 +#define XOTcl_SimplePopFrame(interp,obj) \ + if (!(obj)->nsPtr && ((obj)->varTable == 0)) { \ + (obj)->varTable = Tcl_CallFrame_varTablePtr(framePtr); \ + } \ + if (Tcl_CallFrame_callerPtr(framePtr)) {Interp *iPtr = (Interp *) interp; iPtr->framePtr = Tcl_CallFrame_callerPtr(framePtr); iPtr->varFramePtr = Tcl_CallFrame_callerVarPtr(framePtr); } +#endif #define INCR_REF_COUNT(A) MEM_COUNT_ALLOC("INCR_REF_COUNT",A); Tcl_IncrRefCount(A) Index: generic/xotclStack85.c =================================================================== diff -u -r6ad5c75139b83b9bf0c180d2b2ceceafa8bf69f4 -r5ec6a6f960964d861d68c052d8e2e7d68b711449 --- generic/xotclStack85.c (.../xotclStack85.c) (revision 6ad5c75139b83b9bf0c180d2b2ceceafa8bf69f4) +++ generic/xotclStack85.c (.../xotclStack85.c) (revision 5ec6a6f960964d861d68c052d8e2e7d68b711449) @@ -384,9 +384,12 @@ CallStackPop(Tcl_Interp *interp, XOTclCallStackContent *csc) { #if defined(TCL85STACK_TRACE) - fprintf(stderr, "POP csc=%p, frame %p\n", csc); + fprintf(stderr, "POP csc=%p\n", csc); #endif +#ifdef OBJDELETION_TRACE + fprintf(stderr, "POP csc=%p, obj %s, destroyed %p\n", csc, objectName(csc->self), csc->destroyedCmd); +#endif if (csc->destroyedCmd) { int destroy = 1; TclCleanupCommand((Command *)csc->destroyedCmd); @@ -397,6 +400,9 @@ if (CallStackGetObjectFrame(interp, csc->self)) { destroy = 0; } +#ifdef OBJDELETION_TRACE + fprintf(stderr, " callDoDestroy ?%d\n",destroy); +#endif if (destroy) { CallStackDoDestroy(interp, csc->self); } Index: library/lib/changeXOTclVersion.xotcl =================================================================== diff -u -r5a1a793f1883f3e87cdc80bfabf819a45cb0ac62 -r5ec6a6f960964d861d68c052d8e2e7d68b711449 --- library/lib/changeXOTclVersion.xotcl (.../changeXOTclVersion.xotcl) (revision 5a1a793f1883f3e87cdc80bfabf819a45cb0ac62) +++ library/lib/changeXOTclVersion.xotcl (.../changeXOTclVersion.xotcl) (revision 5ec6a6f960964d861d68c052d8e2e7d68b711449) @@ -6,7 +6,7 @@ # set XOTCL_MAJOR_VERSION 2 set XOTCL_MINOR_VERSION 0 -set XOTCL_RELEASE_LEVEL .0a +set XOTCL_RELEASE_LEVEL .0 # example settings: # 1.0 Index: library/serialize/Serializer.xotcl =================================================================== diff -u -r57fe47fb1da11243f88679d61d3b3b172258525a -r5ec6a6f960964d861d68c052d8e2e7d68b711449 --- library/serialize/Serializer.xotcl (.../Serializer.xotcl) (revision 57fe47fb1da11243f88679d61d3b3b172258525a) +++ library/serialize/Serializer.xotcl (.../Serializer.xotcl) (revision 5ec6a6f960964d861d68c052d8e2e7d68b711449) @@ -1,5 +1,5 @@ # $Id: Serializer.xotcl,v 1.19 2007/10/05 09:06:00 neumann Exp $ -package require XOTcl 1.5 +package require XOTcl package provide xotcl::serializer 1.0 namespace eval ::xotcl::serializer { Index: library/store/XOTclGdbm/configure =================================================================== diff -u -r5a1a793f1883f3e87cdc80bfabf819a45cb0ac62 -r5ec6a6f960964d861d68c052d8e2e7d68b711449 --- library/store/XOTclGdbm/configure (.../configure) (revision 5a1a793f1883f3e87cdc80bfabf819a45cb0ac62) +++ library/store/XOTclGdbm/configure (.../configure) (revision 5ec6a6f960964d861d68c052d8e2e7d68b711449) @@ -11278,3 +11278,5 @@ + + Index: library/store/XOTclGdbm/configure.in =================================================================== diff -u -r5a1a793f1883f3e87cdc80bfabf819a45cb0ac62 -r5ec6a6f960964d861d68c052d8e2e7d68b711449 --- library/store/XOTclGdbm/configure.in (.../configure.in) (revision 5a1a793f1883f3e87cdc80bfabf819a45cb0ac62) +++ library/store/XOTclGdbm/configure.in (.../configure.in) (revision 5ec6a6f960964d861d68c052d8e2e7d68b711449) @@ -303,3 +303,5 @@ + + Index: library/store/XOTclSdbm/configure =================================================================== diff -u -r5a1a793f1883f3e87cdc80bfabf819a45cb0ac62 -r5ec6a6f960964d861d68c052d8e2e7d68b711449 --- library/store/XOTclSdbm/configure (.../configure) (revision 5a1a793f1883f3e87cdc80bfabf819a45cb0ac62) +++ library/store/XOTclSdbm/configure (.../configure) (revision 5ec6a6f960964d861d68c052d8e2e7d68b711449) @@ -11225,3 +11225,5 @@ + + Index: library/store/XOTclSdbm/configure.in =================================================================== diff -u -r5a1a793f1883f3e87cdc80bfabf819a45cb0ac62 -r5ec6a6f960964d861d68c052d8e2e7d68b711449 --- library/store/XOTclSdbm/configure.in (.../configure.in) (revision 5a1a793f1883f3e87cdc80bfabf819a45cb0ac62) +++ library/store/XOTclSdbm/configure.in (.../configure.in) (revision 5ec6a6f960964d861d68c052d8e2e7d68b711449) @@ -262,3 +262,5 @@ + + Index: library/xml/TclExpat-1.1/configure =================================================================== diff -u -r5a1a793f1883f3e87cdc80bfabf819a45cb0ac62 -r5ec6a6f960964d861d68c052d8e2e7d68b711449 --- library/xml/TclExpat-1.1/configure (.../configure) (revision 5a1a793f1883f3e87cdc80bfabf819a45cb0ac62) +++ library/xml/TclExpat-1.1/configure (.../configure) (revision 5ec6a6f960964d861d68c052d8e2e7d68b711449) @@ -11257,3 +11257,5 @@ + + Index: library/xml/TclExpat-1.1/configure.in =================================================================== diff -u -r5a1a793f1883f3e87cdc80bfabf819a45cb0ac62 -r5ec6a6f960964d861d68c052d8e2e7d68b711449 --- library/xml/TclExpat-1.1/configure.in (.../configure.in) (revision 5a1a793f1883f3e87cdc80bfabf819a45cb0ac62) +++ library/xml/TclExpat-1.1/configure.in (.../configure.in) (revision 5ec6a6f960964d861d68c052d8e2e7d68b711449) @@ -261,3 +261,5 @@ + +