/** Closes this native library. Further lookup operations are not allowed after calling this method. */ public final void close() { if (DEBUG) { System.err.println("NativeLibrary.close(): closing " + this); } if ( 0 == libraryHandle ) { throw new RuntimeException("Library already closed"); } final long handle = libraryHandle; libraryHandle = 0; dynLink.closeLibrary(handle); if (DEBUG) { System.err.println("NativeLibrary.close(): Successfully closed " + this); Thread.dumpStack(); } }