01: /*
02: * LostListCmd.java --
03: *
04: * This file test the special cleanup queue for
05: * a CObject in Tcl Blend. A native Tcl_Obj
06: * is created for the TclList instance, if
07: * this object is never preserved or released,
08: * memory from the C side would not get released.
09: * There is a special cleanup queue inside the
10: * CObject class that will handle this by
11: * incrementing and decrementing the ref
12: * count of there sorts of objects when
13: * the method returns.
14: *
15: * Copyright (c) 2002 by Mo DeJong
16: *
17: * See the file "license.terms" for information on usage and redistribution
18: * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
19: *
20: * RCS: @(#) $Id: LostListCmd.java,v 1.1 2002/12/21 04:05:09 mdejong Exp $
21: */
22:
23: package tests;
24:
25: import tcl.lang.*;
26:
27: public class LostListCmd implements Command {
28: public void cmdProc(Interp interp, TclObject[] objv)
29: throws TclException {
30: String s = "1 2 3 4 5";
31: TclObject obj = TclString.newInstance(s);
32: TclObject e1 = TclList.index(interp, obj, 0);
33: TclObject e2 = TclList.index(interp, obj, 1);
34: TclObject e3 = TclList.index(interp, obj, 2);
35: TclObject e4 = TclList.index(interp, obj, 3);
36: TclObject e5 = TclList.index(interp, obj, 4);
37: return;
38: }
39: }
|