Skip to content

Commit

Permalink
ScifioImgSource: close reader only in case of exception
Browse files Browse the repository at this point in the history
  • Loading branch information
dietzc committed Apr 8, 2017
1 parent 3323da7 commit f420016
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion org.knime.knip.io/src/org/knime/knip/io/ScifioImgSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,10 @@ public ImgPlus<RealType> getImg(final String imgRef, final int currentSeries,
m_imgOpener.openImg(getReader(imgRef), getPixelType(imgRef, currentSeries), m_imgFactory, options));
org.apache.log4j.Logger.getLogger(KNIPLogService.class.getSimpleName()).setLevel(m_rootLvl);
return ret;
} finally {
} catch(Exception e) {
m_reader.closeNow();
m_reader = null;
throw e;
}

}
Expand Down

0 comments on commit f420016

Please sign in to comment.