Artifacts Associated With Ticket 2082583fffffffffffffffffffffffffffffffff
Ticket change [988633d2d2] (rid 110616) by nobody on 2008-08-29 15:10:12:
- assignee initialized to: "dkf"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Tcl: 8.6a3 Linux debsam 2.6.18-6-k7 #1 SMP Mon Aug 18 09:20:26 UTC 2008 i686 GNU/Linux This don't work: ---- begin mydo.c ---- #include <tcl.h> #include <tclOO.h> int do_call ( ClientData clientData, Tcl_Interp* interp, Tcl_ObjectContext objContext, int objc, Tcl_Obj* const objv[] ) { Tcl_SetResult (interp, "do", TCL_VOLATILE); return TCL_OK; }; int Mydo_Init (Tcl_Interp* interp) { Tcl_Obj* ooClassName; Tcl_Object ooClassObject; Tcl_Class ooClass; Tcl_Object newClassObject; Tcl_Class newClass; Tcl_Obj* doMethodName; Tcl_Method doMethod; Tcl_MethodType doMethodType = { TCL_OO_METHOD_VERSION_CURRENT, "do", do_call, NULL, NULL }; ooClassName = Tcl_NewStringObj ("oo::class", -1); ooClassObject = Tcl_GetObjectFromObj (interp, ooClassName); ooClass = Tcl_GetObjectAsClass (ooClassObject); newClassObject = Tcl_NewObjectInstance (interp, ooClass, "MyClass", NULL, 0, NULL, 0); newClass = Tcl_GetObjectAsClass (newClassObject); doMethodName = Tcl_NewStringObj ("do", -1); doMethod = Tcl_NewMethod (interp, newClass, doMethodName, 1, &doMethodType, NULL); return TCL_OK; } ----- begin make ---- gcc -shared -Wl,-soname,libmydo.so $(TCL_CFLAGS) $(TCL_LIBS) -o libmydo.so mydo.c ---- begin mydo.tcl ---- puts "load ./libmydo.so" load ./libmydo.so puts "MyClass create obj" MyClass create obj puts "set do \[obj do\]" set do [obj do];# here is a problem puts do=$do ---- end mydo.tcl ---- It work, if I change 'doMethodType' to: "static Tcl_MethodType doMethodType = { ..." Perhaps, Tcl_NewMethod sould use internal a copy of Tcl_MethodType and not work with original? [email protected] - foundin initialized to: "obsolete: 8.6a3"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "35. TclOO Package"
- title initialized to: "Tcl_NewMethod memory (un)allocation"
- type initialized to: "Bug"
Ticket change [5d4a26f7f0] (rid 115439) by dkf on 2008-08-29 22:34:56:
- icomment:
Logged In: YES user_id=79902 Originator: NO What on earth is wrong with just using a static structure? The method type descriptor really is something I'd not expect to be changing during the life of a program.
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [db4c584b2f] (rid 107935) by nobody on 2008-08-30 03:50:53:
- icomment:
Logged In: NO My mistake. This can be closed. This isn't a bug. The poiner to 'Tcl_ObjectMetadataType*' is the unique key of every metadata, and not somewhat other. [email protected]
- login: "[email protected]"
- mimetype: "text/plain"
- username: "[email protected]"
- icomment:
Ticket change [41c168b055] (rid 116242) by dkf on 2008-09-02 22:57:42:
- closedate changed to: "2008-09-02T15:57:42"
- closer changed to: "dkf"
- resolution changed to: "Wont Fix"
- status changed to: "Closed"