Skip to content

Latest commit

 

History

History
17 lines (14 loc) · 562 Bytes

File metadata and controls

17 lines (14 loc) · 562 Bytes

Cleanup

A small library that implements a cleanup callback for when an object is no longer refrenced and the GarbageCollector runs.

Build Status

Example

public class TestClass{
    publiic TestClass(){
        long handle = allocateNativeResource();
        Cleaner.addCleaner(this, ()->freeNativeResource(handle));
    }

    private native long allocateNativeResource();
    private native void freeNativeResource(long handle);
}