Index: generic/xotcl.c =================================================================== diff -u -r018ced50b0b8139c67310d99f9541e933b7a1f2d -r4486d6fcdfe92418d68bf73e9c75dc869b78902e --- generic/xotcl.c (.../xotcl.c) (revision 018ced50b0b8139c67310d99f9541e933b7a1f2d) +++ generic/xotcl.c (.../xotcl.c) (revision 4486d6fcdfe92418d68bf73e9c75dc869b78902e) @@ -1606,6 +1606,9 @@ if (!cl->opt) { cl->opt = NEW(XOTclClassOpt); memset(cl->opt, 0, sizeof(XOTclClassOpt)); + if (cl->object.flags & XOTCL_IS_CLASS) { + cl->opt->id = cl->object.id; /* probably a temporary solution */ + } } return cl->opt; } @@ -3261,6 +3264,7 @@ static void RemoveFromClassMixinsOf(Tcl_Command cmd, XOTclCmdList *cmdlist) { + for ( ; cmdlist; cmdlist = cmdlist->next) { XOTclClass *ncl = XOTclGetClassFromCmdPtr(cmdlist->cmdPtr); XOTclClassOpt *nclopt = ncl ? ncl->opt : NULL; @@ -3358,8 +3362,20 @@ MEM_COUNT_FREE("Tcl_InitHashTable", commandTable); Tcl_DeleteHashTable(commandTable); } - +static void +MixinResetOrderForAllInstances(Tcl_Interp *interp, XOTclClass *cl) { + XOTclClasses *sl = cl->sub; + XOTclClasses *sc; + + /* fprintf(stderr,"\t reset for %s\n",ObjStr(cl->object.cmdName));*/ + MixinResetOrderForInstances(interp, cl); + for (sc = sl; sc != 0; sc = sc->next) { + MixinResetOrderForAllInstances(interp, sc->cl); + } +} + + /* * if the class hierarchy or class mixins have changed -> * invalidate mixin entries in all dependent instances @@ -3423,8 +3439,9 @@ hPtr = Tcl_NextHashEntry(&hSrch)) { char *key = Tcl_GetHashKey(commandTable, hPtr); XOTclClass *ncl = XOTclpGetClass(interp, key); + /* fprintf(stderr,"Got %s, reset for ncl %p\n",key,ncl);*/ if (ncl) { - MixinResetOrderForInstances(interp, ncl); + MixinResetOrderForAllInstances(interp, ncl); } } MEM_COUNT_FREE("Tcl_InitHashTable", commandTable); @@ -7377,8 +7394,7 @@ /* * Remove this class from all isClassMixinOf lists and clear the instmixin list */ - - RemoveFromClassMixinsOf(cl->object.id, clopt->instmixins); + RemoveFromClassMixinsOf(clopt->id, clopt->instmixins); CmdListRemoveList(&clopt->instmixins, GuardDel); MixinInvalidateObjOrders(interp, cl); @@ -7391,14 +7407,14 @@ * Remove this class from all mixin lists and clear the isObjectMixinOf list */ - RemoveFromMixins(cl->object.id, clopt->isObjectMixinOf); + RemoveFromMixins(clopt->id, clopt->isObjectMixinOf); CmdListRemoveList(&clopt->isObjectMixinOf, GuardDel); /* * Remove this class from all instmixin lists and clear the isClassMixinOf list */ - RemoveFromInstmixins(cl->object.id, clopt->isClassMixinOf); + RemoveFromInstmixins(clopt->id, clopt->isClassMixinOf); CmdListRemoveList(&clopt->isClassMixinOf, GuardDel); } /* remove dependent filters of this class from all subclasses*/