Index: generic/nsf.c =================================================================== diff -u -r4265c280c2d31f281e33fc0cddd9ebdd798ebc06 -rb252a0a0d40f1125c6ad5fa4269bfb500bfd034f --- generic/nsf.c (.../nsf.c) (revision 4265c280c2d31f281e33fc0cddd9ebdd798ebc06) +++ generic/nsf.c (.../nsf.c) (revision b252a0a0d40f1125c6ad5fa4269bfb500bfd034f) @@ -12875,6 +12875,12 @@ int bool; Tcl_GetBooleanFromObj(interp, pPtr->defaultValue, &bool); pcPtr->objv[i] = Tcl_NewBooleanObj(!bool); + /* + * incr refcount, otherwise the Tcl_Obj might be shared + */ + INCR_REF_COUNT(pcPtr->objv[i]); + pcPtr->flags[i] |= NSF_PC_MUST_DECR; + pcPtr->status |= NSF_PC_STATUS_MUST_DECR; } } else { /* no valued passed, check if default is available */ @@ -13558,12 +13564,12 @@ int subcmd, int withPer_object) { assert(methodName); + Tcl_ResetResult(interp); - /*fprintf(stderr, "ListMethod %s %s cmd %p subcmd %d per-object %d\n", - ObjectName(regObject), methodName, cmd, subcmd, withPer_object);*/ - if (!cmd) { - Tcl_SetObjResult(interp, NsfGlobalObjs[NSF_EMPTY]); + if (subcmd == InfomethodsubcmdExistsIdx) { + Tcl_SetObjResult(interp, Tcl_NewIntObj(0)); + } } else { Tcl_ObjCmdProc *procPtr = Tcl_Command_objProc(cmd); int outputPerObject = 0; @@ -13583,6 +13589,11 @@ Tcl_SetObjResult(interp, MethodHandleObj(regObject, withPer_object, methodName)); return TCL_OK; } + case InfomethodsubcmdExistsIdx: + { + Tcl_SetObjResult(interp, Tcl_NewIntObj(1)); + return TCL_OK; + } case InfomethodsubcmdArgsIdx: { Tcl_Command importedCmd = GetOriginalCommand(cmd); @@ -18216,7 +18227,7 @@ /* objectInfoMethod method NsfObjInfoMethodMethod { - {-argName "infomethodsubcmd" -type "args|body|definition|handle|parameter|parametersyntax|type|precondition|postcondition|subcommands"} + {-argName "infomethodsubcmd" -type "args|body|exists|definition|handle|parameter|parametersyntax|type|precondition|postcondition|subcommands"} {-argName "name" -required 1 -type tclobj} } */ @@ -18471,7 +18482,7 @@ /* classInfoMethod method NsfClassInfoMethodMethod { - {-argName "infomethodsubcmd" -type "args|body|definition|handle|parameter|parametersyntax|type|precondition|postcondition|subcommands"} + {-argName "infomethodsubcmd" -type "args|body|exists|definition|handle|parameter|parametersyntax|type|precondition|postcondition|subcommands"} {-argName "name" -required 1 -type tclobj} } */