Skip to content

Instantly share code, notes, and snippets.

/-

Created January 12, 2015 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/54f51b1241cd85feac19 to your computer and use it in GitHub Desktop.
Save anonymous/54f51b1241cd85feac19 to your computer and use it in GitHub Desktop.
diff --git a/core/src/main/java/org/jruby/Main.java b/core/src/main/java/org/jruby/Main.java
index 3d21b55..fb0f7af 100644
--- a/core/src/main/java/org/jruby/Main.java
+++ b/core/src/main/java/org/jruby/Main.java
@@ -300,8 +300,11 @@ public class Main {
return doRunFromMain(runtime, in, filename);
}
} finally {
- if (didTeardown.compareAndSet(false, true)) {
- runtime.tearDown();
+ if (config.isHardExit()) {
+ // we're the command-line JRuby, and should shut down at exit
+ if (didTeardown.compareAndSet(false, true)) {
+ runtime.tearDown();
+ }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment