Skip to content

Commit 3deb822

Browse files
committed
close Writer object from createWriter() (fixes processing#3705)
1 parent bc51b2c commit 3deb822

4 files changed

Lines changed: 19 additions & 2 deletions

File tree

core/src/processing/data/JSONArray.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,10 @@ public Object remove(int index) {
10991099

11001100

11011101
public boolean save(File file, String options) {
1102-
return write(PApplet.createWriter(file), options);
1102+
PrintWriter writer = PApplet.createWriter(file);
1103+
boolean success = write(writer, options);
1104+
writer.close();
1105+
return success;
11031106
}
11041107

11051108

core/src/processing/data/JSONObject.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1554,7 +1554,10 @@ static protected void testValidity(Object o) {
15541554

15551555

15561556
public boolean save(File file, String options) {
1557-
return write(PApplet.createWriter(file), options);
1557+
PrintWriter writer = PApplet.createWriter(file);
1558+
boolean success = write(writer, options);
1559+
writer.close();
1560+
return success;
15581561
}
15591562

15601563

core/todo.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ X Wrong positioning of circles in SVG shapes (regression from 2)
55
X https://github.com/processing/processing/issues/3685
66
X setFill() on PShape in Java2D throws ArrayIndexOutOfBoundsException
77
X https://github.com/processing/processing/issues/3677
8+
X saveJSONObject() doesn't close the file
9+
X https://github.com/processing/processing/issues/3705
810

911
jakub
1012
X keyTyped() not firing with P2D and P3D
@@ -30,6 +32,10 @@ X https://github.com/processing/processing/issues/3621
3032
X "Internal graphics not initialized yet"
3133
X https://github.com/processing/processing/issues/3690
3234
X https://github.com/processing/processing/pull/3692
35+
X Remove support for fixed-function pipeline
36+
X https://github.com/processing/processing/issues/3505
37+
_ NullPointerException in Demos > Graphics > Planets
38+
_ https://github.com/processing/processing/issues/3551
3339

3440
cleaning
3541
X How do images behave when pixelDensity(2) is set?

todo.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ X no special case added for 10.8, but it's on the way out
1313
X move processing.mode.java.pdex.XQErrorTable to processing.ui.ErrorTable
1414
X need to make the list abstract, also "scroll to line" feature
1515
X fix red in sidebar, the squiggly line beneath code
16+
_ ast generator complains about F instead of f after floats
17+
_ https://github.com/processing/processing/issues/3707
18+
o 3.0b4 demos fail to create PDF files
19+
_ https://github.com/processing/processing/issues/3708
20+
1621

1722
contribs
1823
X Undo does not move to the correct location in the editor window

0 commit comments

Comments
 (0)