Class AbstractOpenCLObject

java.lang.Object
com.jme3.opencl.AbstractOpenCLObject
All Implemented Interfaces:
OpenCLObject
Direct Known Subclasses:
Buffer, CommandQueue, Context, Event, Image, Kernel, Program

public abstract class AbstractOpenCLObject extends Object implements OpenCLObject
Abstract implementation of OpenCLObject providing the release mechanisms.
  • Field Details

  • Constructor Details

  • Method Details

    • register

      public AbstractOpenCLObject register()
      Description copied from interface: OpenCLObject
      Registers this object for automatic releasing on garbage collection. By default, OpenCLObjects are not registered in the OpenCLObjectManager, you have to release it manually by calling OpenCLObject.release(). Without registering or releasing, a memory leak might occur.
      Returns this to allow calls like Buffer buffer = clContext.createBuffer(1024).register();.
      Specified by:
      register in interface OpenCLObject
      Returns:
      this
    • release

      public void release()
      Description copied from interface: OpenCLObject
      Releases this native object. Should delegate to getReleaser().release().
      Specified by:
      release in interface OpenCLObject
    • finalize

      protected void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable
    • getReleaser

      public OpenCLObject.ObjectReleaser getReleaser()
      Description copied from interface: OpenCLObject
      Returns the releaser object. Multiple calls should return the same object. The ObjectReleaser is used to release the OpenCLObject when it is garbage collected. Therefore, the returned object must not hold a reference to the OpenCLObject.
      Specified by:
      getReleaser in interface OpenCLObject
      Returns:
      the object releaser