[cairo-commit] cairo-java/src/java/org/freedesktop/cairo Surface.java, 1.10, 1.11

Jeffrey Morgan commit at pdx.freedesktop.org
Mon May 9 09:02:11 PDT 2005


Committed by: kuzman

Update of /cvs/cairo/cairo-java/src/java/org/freedesktop/cairo
In directory gabe:/tmp/cvs-serv12741/src/java/org/freedesktop/cairo

Modified Files:
	Surface.java 
Log Message:
added code to perform proper referencing of objects.

Index: Surface.java
===================================================================
RCS file: /cvs/cairo/cairo-java/src/java/org/freedesktop/cairo/Surface.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- Surface.java	9 May 2005 14:47:03 -0000	1.10
+++ Surface.java	9 May 2005 16:02:07 -0000	1.11
@@ -17,13 +17,7 @@
 public class Surface extends CairoObject {
 	
     public Surface() {
-        super(initRef());
-    }
-    
-    static Handle initRef() {
-        Handle hndl = getNullHandle();
-        cairo_surface_reference(hndl);
-        return hndl;
+        super(alloc());
     }
     
     Surface(Handle hndl) {
@@ -56,8 +50,8 @@
      * Native calls
      */
     native static final private Handle cairo_surface_create_similar(Handle other, int format, int width, int height);
-    // TODO: JNI is wrong here - should use alloc and remove ref
-    native static final private void cairo_surface_reference(Handle obj);
+    // TODO: JNI need alloc
+    native static final private Handle alloc();
     native static final private void cairo_surface_destroy(Handle obj);
     native static final private int cairo_surface_finish(Handle obj);
 	




More information about the cairo-commit mailing list