org.lwjgl.system.NativeResource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.lwjgl.lwjgl Show documentation
Show all versions of org.lwjgl.lwjgl Show documentation
LWJGL OSGi bundle (Core LWJGL bundle)
The newest version!
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
*/
package org.lwjgl.system;
/**
* Classes that implement this interface are associated with one or more native resources. These resources must be explicitly freed when a class instance is
* no longer used, by calling the {@link #free} method.
*
* This interface extends {@link AutoCloseable}, which means that implementations may be used as resources in try-with-resources statements.
*/
public interface NativeResource extends AutoCloseable {
/** Frees any native resources held by this object. */
void free();
@Override
default void close() {
free();
}
}