summaryrefslogtreecommitdiffstats
path: root/src/com/jogamp/opencl/CLObject.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/jogamp/opencl/CLObject.java')
-rw-r--r--src/com/jogamp/opencl/CLObject.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/com/jogamp/opencl/CLObject.java b/src/com/jogamp/opencl/CLObject.java
index ec17a518..3bd7b14b 100644
--- a/src/com/jogamp/opencl/CLObject.java
+++ b/src/com/jogamp/opencl/CLObject.java
@@ -4,7 +4,7 @@ package com.jogamp.opencl;
* Common superclass for all OpenCL objects.
* @author Michael Bien
*/
-abstract class CLObject {
+abstract class CLObject implements AutoCloseable {
/**
* The OpenCL object handle.
@@ -28,6 +28,19 @@ abstract class CLObject {
}
/**
+ * Implementation detail.
+ * TODO remove as soon we have extension methods.
+ * @deprecated This method is not intended to be called from client code.
+ * @see java.lang.AutoCloseable
+ */
+ @Deprecated
+ public final void close() {
+ if(this instanceof CLResource) {
+ ((CLResource)this).release();
+ }
+ }
+
+ /**
* Returns the context for this OpenCL object.
*/
public CLContext getContext() {