-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HtmlFormatter doesn't close Stream for embedded image. #1108
Labels
good first issue
Good for newcomers
Comments
Looks like an easy fix. I think you're best of submitting a PR and possibly writing a test. Otherwise I would recommend:
Uses the json output and works better overall. |
mpkorstanje
added a commit
that referenced
this issue
Jul 9, 2017
Refactored the code around streams so it follows these rules: - Streams should be closed by their owners - A stream is owned by its creator or when provided as a constructor argument - Stream ownership should be the smallest possible unit. The method, class, process, system. - System.out and System.error may never be closed Fixes #1108
mpkorstanje
added a commit
that referenced
this issue
Jul 9, 2017
Refactored the code around streams so it follows these rules: - Streams should be closed by their owners - A stream is owned by its creator or when provided as a constructor argument - Stream ownership should be the smallest possible unit. The method, class, process, system. - System.out and System.error may never be closed Fixes #1108
6 tasks
mpkorstanje
added a commit
that referenced
this issue
Jul 9, 2017
Refactored the code around streams so it follows these rules: - Streams should be closed by their owners - A stream is owned by its creator or when provided as a constructor argument - Stream ownership should be the smallest possible unit. The method, class, process, system. - System.out and System.error may never be closed Fixes #1108
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Summary
It looks like the HtmlFormatter forgets to close the FileOutputStream of an image being embedded.
Expected Behavior
The HtmlFormatter should close all streams and there should be no log-error about a stream not being closed.
Current Behavior
Although my tests pass, I get the following exception:
Possible Solution
In HtmlFormatter there is a private method
writeBytesAndClose(byte[], OutputStream)
, which writes bytes, but does not close the stream as the method-name indicates. Closing the stream could possibly help.Context & Motivation
If not fixed, I'm scared of a memory-leak, when our test-suite grows.
Your Environment
The text was updated successfully, but these errors were encountered: