Skip to content

A small Java library that offers object cleanup when they leave scope

License

Notifications You must be signed in to change notification settings

gudenau/java-cleanup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);
}

About

A small Java library that offers object cleanup when they leave scope

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages