> A different solution is needed. What about never returning any CObjects in
> TclBlend? Methods such as interp.setVar, interp.getVar, interp.getResult
> still returns TclObject, but the resulting TclObject would not contain
> CObject as the internal rep. For example, any Tcl_Obj can be converted into
> a TclString representation. Then the TclString is returned inside a
> TclObject. TclString can be safely GC'ed because it has no link to any Tcl
> C data structures.
Now there is an interesting idea. Check out the attached screen shot, the
only place where CObject is actually extended is in the TclList class.
I guess this was done so that a Tcl List would not need to get converted
to a Java Vector if it was to be used from Java code. Are TclList internal
reps the only area where we have a problem? I think that is the case but
I am not sure.
Mo DeJong
Red Hat Inc
tcllist.png