radkovo / CSSBox

CSSBox is an (X)HTML/CSS rendering engine written in pure Java. Its primary purpose is to provide a complete information about the rendered page suitable for further processing. However, it also allows displaying the rendered document.
http://cssbox.sourceforge.net/
GNU Lesser General Public License v3.0
234 stars 76 forks source link

not properly closed connection/file? #36

Open jjYBdx4IL opened 7 years ago

jjYBdx4IL commented 7 years ago

I have some "cannot delete file" problems on Windows when using DefaultDocumentSource against local files. That problem disappears when reading the source using a try-with-resources construct myself.

I think the problem is due to the fact that the result of getInputStream() in the following source code line

https://github.com/radkovo/CSSBox/blob/e49013460a58bbb14be72174aa364d8c39be8166/src/main/java/org/fit/cssbox/io/DefaultDOMSource.java#L63

does not get stored and thereby cannot be closed explicitly/in time.