*** /space/home/jwu/tcl/blend.orig/tclBlend1.2.6/src/tclblend/tcl/lang/CObject.java	Tue Aug 22 10:35:08 2000
--- CObject.java	Tue Aug 22 10:34:52 2000
***************
*** 13,18 ****
--- 13,19 ----
   */
  
  package tcl.lang;
+ import java.util.Vector;
  
  /*
   * The CObject class encapsulates a reference to a Tcl_Obj implemented in
***************
*** 52,58 ****
  CObject()
  {
      this.objPtr = newCObject(null);
!     incrRefCount(objPtr);
  }
  
  /*
--- 53,59 ----
  CObject()
  {
      this.objPtr = newCObject(null);
!     //    incrRefCount(objPtr);
  }
  
  /*
***************
*** 75,81 ****
      long objPtr)		// Pointer to Tcl_Obj from C.
  {
      this.objPtr = objPtr;
!     incrRefCount(objPtr);
  }
  
  /*
--- 76,82 ----
      long objPtr)		// Pointer to Tcl_Obj from C.
  {
      this.objPtr = objPtr;
!     // incrRefCount(objPtr);
  }
  
  /*
***************
*** 97,103 ****
  public void
  dispose()
  {
!     decrRefCount(objPtr);
      objPtr = 0;
  }
  
--- 98,104 ----
  public void
  dispose()
  {
!     // decrRefCount(objPtr);
      objPtr = 0;
  }
  
***************
*** 154,159 ****
--- 155,204 ----
  /*
   *----------------------------------------------------------------------
   *
+  * incrRefCount --
+  *
+  *	Increment the reference count of the internal Tcl_Obj.
+  *
+  * Results:
+  *	None.
+  *
+  * Side effects:
+  *	None.
+  *
+  *----------------------------------------------------------------------
+  */
+ 
+ protected void
+ incrRefCount()
+ {
+     incrRefCount(objPtr);
+ }
+ 
+ /*
+  *----------------------------------------------------------------------
+  *
+  * decrRefCount --
+  *
+  *	Decrement the reference count of the internal Tcl_Obj.
+  *
+  * Results:
+  *	None.
+  *
+  * Side effects:
+  *	None.
+  *
+  *----------------------------------------------------------------------
+  */
+ 
+ protected void
+ decrRefCount()
+ {
+     decrRefCount(objPtr);
+ }
+ 
+ /*
+  *----------------------------------------------------------------------
+  *
   * toString --
   *
   *	Return the string form of the internal rep.  Calls down to
***************
*** 216,229 ****
  
  protected void finalize() throws Throwable
  {
!     if (objPtr != 0) {
  	/*
  	 * If the object is finalized while the reference is still valid, 
  	 * we need to sever the connection to the underlying Tcl_Obj*.
  	 */
  
  	decrRefCount(objPtr);
!     }
      super.finalize();
  }
  
--- 261,278 ----
  
  protected void finalize() throws Throwable
  {
! //    if (objPtr != 0) {
  	/*
  	 * If the object is finalized while the reference is still valid, 
  	 * we need to sever the connection to the underlying Tcl_Obj*.
  	 */
  
+ /*	System.err.println("!!! WARNING: attempt to free a Tcl_Obj 0x" +
+ 			   Long.toHexString(objPtr) +
+ 			   " {" + getString(objPtr) +
+ 			   "}.");
  	decrRefCount(objPtr);
!     } */
      super.finalize();
  }
  
***************
*** 329,334 ****
  makeRef(
      long objPtr,		// Pointer to Tcl_Obj.
      TclObject object);		// Object that Tcl_Obj should refer to.
- 
  } // end CObject
  
--- 378,383 ----
  makeRef(
      long objPtr,		// Pointer to Tcl_Obj.
      TclObject object);		// Object that Tcl_Obj should refer to.
  } // end CObject
+ 
  

