Changeset 7226


Ignore:
Timestamp:
11/22/10 07:28:55 (9 years ago)
Author:
callan
Message:

Attempt to fix issues with leaking file handles during planar writing introduced in r7155. (See  omero:#2764)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/bio-formats/src/loci/formats/out/TiffWriter.java

    r7225 r7226  
    235235    IFD ifd = new IFD(); 
    236236    TiffParser parser = new TiffParser(currentId); 
    237     long[] ifdOffsets = parser.getIFDOffsets(); 
    238     if (no < ifdOffsets.length) { 
    239       ifd = parser.getIFD(ifdOffsets[no]); 
     237    try { 
     238      long[] ifdOffsets = parser.getIFDOffsets(); 
     239      if (no < ifdOffsets.length) { 
     240        ifd = parser.getIFD(ifdOffsets[no]); 
     241      } 
     242    } 
     243    finally { 
     244      RandomAccessInputStream tiffParserStream = parser.getStream(); 
     245      if (tiffParserStream != null) { 
     246        tiffParserStream.close(); 
     247      } 
    240248    } 
    241249 
Note: See TracChangeset for help on using the changeset viewer.