git://git.nikiroo.be
/
nikiroo-utils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
compact
(merge:
abfeadc
679c6a1
)
Merge branch 'subtree'
author
Niki Roo
<niki@nikiroo.be>
Tue, 26 May 2020 19:09:45 +0000
(21:09 +0200)
committer
Niki Roo
<niki@nikiroo.be>
Tue, 26 May 2020 19:09:45 +0000
(21:09 +0200)
1
2
src/be/nikiroo/utils/Image.java
patch
|
diff1
|
diff2
|
blob
|
history
diff --combined
src/be/nikiroo/utils/Image.java
index 4518577d640b684bee939381e02b9aa745b2d3a2,9b28835e0fd61585023edf83db5ba19dea0030db..9b28835e0fd61585023edf83db5ba19dea0030db
---
1
/
src/be/nikiroo/utils/Image.java
---
2
/
Image.java
+++ b/
src/be/nikiroo/utils/Image.java
@@@
-116,7
-116,13
+116,13
@@@
public class Image implements Closeable
* in case of I/O error
*/
public InputStream newInputStream() throws IOException {
- return new MarkableFileInputStream(data);
+ synchronized (instanceLock) {
+ if (data == null) {
+ throw new IOException("Image was close()d");
+ }
+
+ return new MarkableFileInputStream(data);
+ }
}
/**
@@@
-175,6
-181,7
+181,7
@@@
@Override
public void close() throws IOException {
synchronized (instanceLock) {
+ new Exception().printStackTrace();
if (size >= 0) {
size = -1;
data.delete();