Close the native library we're mapped to.
()
| 685 | |
| 686 | /** Close the native library we're mapped to. */ |
| 687 | public void close() { |
| 688 | Set<String> keys = new HashSet<>(); |
| 689 | synchronized(libraries) { |
| 690 | for (Map.Entry<String, Reference<NativeLibrary>> e : libraries.entrySet()) { |
| 691 | Reference<NativeLibrary> ref = e.getValue(); |
| 692 | if (ref.get() == this) { |
| 693 | keys.add(e.getKey()); |
| 694 | } |
| 695 | } |
| 696 | |
| 697 | for (String k : keys) { |
| 698 | libraries.remove(k); |
| 699 | } |
| 700 | } |
| 701 | |
| 702 | synchronized(this) { |
| 703 | if (handle != 0) { |
| 704 | handle = 0; |
| 705 | cleanable.clean(); |
| 706 | } |
| 707 | } |
| 708 | } |
| 709 | |
| 710 | @Deprecated |
| 711 | public void dispose() { |