Permalink
Browse files

Reinstate Tempfile finalizer to ensure it is deleted. Fixes #1133

  • Loading branch information...
1 parent 90a814e commit 5561fcd5311a82e8721289b2c097c03c450cd45a @headius headius committed Oct 21, 2013
Showing with 10 additions and 0 deletions.
  1. +9 −0 core/src/main/java/org/jruby/ext/tempfile/Tempfile.java
  2. +1 −0 test/jruby.1.9.index
@@ -269,4 +269,13 @@ public IRubyObject inspect() {
val.append(">");
return getRuntime().newString(val.toString());
}
+
+ @Override
+ protected void finalize() throws Throwable {
+ try {
+ super.finalize();
+ } finally {
+ tmpFile.delete();
+ }
+ }
}
View
@@ -102,3 +102,4 @@ test_jar_file
test_jruby_synchronized
test_instantiating_interfaces
test_openssl
+test_tempfile_cleanup

0 comments on commit 5561fcd

Please sign in to comment.