Index: generic/nsf.c =================================================================== diff -u -rd66258cafa0a21e1b10fa42951de7e71f63a1817 -rb0bfe3f3bf2e7fd2c14c58eeedca34b734803ecd --- generic/nsf.c (.../nsf.c) (revision d66258cafa0a21e1b10fa42951de7e71f63a1817) +++ generic/nsf.c (.../nsf.c) (revision b0bfe3f3bf2e7fd2c14c58eeedca34b734803ecd) @@ -21417,18 +21417,43 @@ * Omit storm of invalidations on shutdown. */ if (unlikely(RUNTIME_STATE(interp)->exitHandlerDestroyRound == NSF_EXITHANDLER_OFF)) { - NsfClasses *subClasses = TransitiveSubClasses(cl), *clPtr; + Tcl_HashTable objTable, *commandTable = &objTable; + Tcl_HashSearch hSrch; + Tcl_HashEntry *hPtr; + + /* NsfClasses *subClasses = TransitiveSubClasses(cl), *clPtr; */ + /* * invalidate cached parameters in subclasses - */ - for (clPtr = subClasses; clPtr; clPtr = clPtr->nextPtr) { + * + for (clPtr = subClasses; clPtr; clPtr = clPtr->nextPtr) { NsfClass *subClass = clPtr->cl; if (subClass->parsedParamPtr) { ParsedParamFree(subClass->parsedParamPtr); subClass->parsedParamPtr = NULL; } } NsfClassListFree(subClasses); + */ + + Tcl_InitHashTable(commandTable, TCL_ONE_WORD_KEYS); + MEM_COUNT_ALLOC("Tcl_InitHashTable", commandTable); + GetAllClassMixinsOf(interp, commandTable, Tcl_GetObjResult(interp), + cl, 1, 0, NULL, NULL); + + for (hPtr = Tcl_FirstHashEntry(commandTable, &hSrch); hPtr; + hPtr = Tcl_NextHashEntry(&hSrch)) { + NsfClass *mixinOfClass = (NsfClass *)Tcl_GetHashKey(commandTable, hPtr); + if (mixinOfClass) { + /* fprintf(stderr, "mixinOfClass %s\n", ClassName(mixinOfClass)); */ + if (mixinOfClass->parsedParamPtr) { + ParsedParamFree(mixinOfClass->parsedParamPtr); + mixinOfClass->parsedParamPtr = NULL; + } + } + } + Tcl_DeleteHashTable(commandTable); + MEM_COUNT_FREE("Tcl_InitHashTable", commandTable); } return TCL_OK; Index: tests/properties.test =================================================================== diff -u -rd66258cafa0a21e1b10fa42951de7e71f63a1817 -rb0bfe3f3bf2e7fd2c14c58eeedca34b734803ecd --- tests/properties.test (.../properties.test) (revision d66258cafa0a21e1b10fa42951de7e71f63a1817) +++ tests/properties.test (.../properties.test) (revision b0bfe3f3bf2e7fd2c14c58eeedca34b734803ecd) @@ -873,7 +873,53 @@ ? {b1 configure -y 2} "" } +nx::test case extend-class-mixin-info { + + nx::Class create Baz + nx::Class create Foo -mixin Baz + nx::Class create Bar -mixin Foo + Bar create bar; # cache becomes hot! + ? {llength [Bar info configure parameters]} 4 + Foo property y + ? {llength [Bar info configure parameters]} 5 + + Baz property z + ? {llength [Bar info configure parameters]} 6 + + Baz delete property z + ? {llength [Bar info configure parameters]} 5 + + Foo delete property y + ? {llength [Bar info configure parameters]} 4 + +} + +nx::test case extend-class-mixin-configure { + + nx::Class create Baz + nx::Class create Foo -mixin Baz + nx::Class create Bar -mixin Foo + Bar create bar; # cache becomes hot! + + Foo property y + bar configure -y 1 + ? {bar cget -y} 1 + + Baz property z + bar configure -z 2 + ? {bar cget -z} 2 + bar configure -y 3 + ? {bar cget -y} 3 + + Bar property w + bar configure -w 4 + ? {bar cget -w} 4 + +} + + + # # Local variables: # mode: tcl