File tree 2 files changed +7
-0
lines changed
core/src/main/java/org/jruby
2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -2049,6 +2049,8 @@ protected IRubyObject rbIoClose(Ruby runtime) {
2049
2049
if (fptr == null ) return runtime .getNil ();
2050
2050
if (fptr .fd () == null ) return runtime .getNil ();
2051
2051
2052
+ fptr .finalizeFlush (context , false );
2053
+
2052
2054
// interrupt waiting threads
2053
2055
fptr .interruptBlockingThreads (context );
2054
2056
try {
@@ -2057,6 +2059,7 @@ protected IRubyObject rbIoClose(Ruby runtime) {
2057
2059
} finally {
2058
2060
fptr .lock ();
2059
2061
}
2062
+
2060
2063
fptr .cleanup (runtime , false );
2061
2064
2062
2065
if (fptr .getProcess () != null ) {
Original file line number Diff line number Diff line change @@ -838,6 +838,10 @@ public void finalize() {
838
838
}
839
839
840
840
public void finalize (ThreadContext context , boolean noraise ) {
841
+ finalizeFlush (context , noraise );
842
+ }
843
+
844
+ public void finalizeFlush (ThreadContext context , boolean noraise ) {
841
845
IRubyObject err = runtime .getNil ();
842
846
ChannelFD fd = this .fd ();
843
847
Closeable stdio_file = this .stdio_file ;
You can’t perform that action at this time.
0 commit comments