/** {@inheritDoc} */ @Override public void release() throws IOException { LOG.debug("Releasing {}", this); final int counter = mRetainCount.decrementAndGet(); Preconditions.checkState(counter >= 0, "Cannot release Fiji instance %s: retain counter is now %s.", this, counter); if (counter == 0) { close(); } }