diff --git a/org/openslide/OpenSlide.java b/org/openslide/OpenSlide.java index 53b8733..4f7ce26 100644 --- a/org/openslide/OpenSlide.java +++ b/org/openslide/OpenSlide.java @@ -188,16 +188,22 @@ public OpenSlide(File file) throws IOException { hashCodeVal = canonicalFile.hashCode(); } } catch (IOException e) { - // dispose, we are in the constructor - dispose(); + // close, we are in the constructor + close(); throw e; } } - public void dispose() { + @Override + public void close() { errorCtx.getOsr().close(); } + @Deprecated + public void dispose() { + close(); + } + public int getLevelCount() { return levelCount; } @@ -445,9 +451,4 @@ public boolean equals(Object obj) { return false; } - - @Override - public void close() { - dispose(); - } } diff --git a/org/openslide/TestCLI.java b/org/openslide/TestCLI.java index da8ea6d..2068461 100644 --- a/org/openslide/TestCLI.java +++ b/org/openslide/TestCLI.java @@ -54,7 +54,7 @@ public static void main(String args[]) throws IOException { long w, h; - osr.dispose(); + osr.close(); try (OpenSlideCache cache = new OpenSlideCache(64 << 20)) { osr = new OpenSlide(f); @@ -83,6 +83,6 @@ public static void main(String args[]) throws IOException { test_next_biggest(osr, 1000); test_next_biggest(osr, 10000); - osr.dispose(); + osr.close(); } }