diff --git a/bundles/org.openhab.automation.jrubyscripting/src/main/java/org/openhab/automation/jrubyscripting/internal/JRubyEngineWrapper.java b/bundles/org.openhab.automation.jrubyscripting/src/main/java/org/openhab/automation/jrubyscripting/internal/JRubyEngineWrapper.java index 3a48c9b236..2cc24197ce 100644 --- a/bundles/org.openhab.automation.jrubyscripting/src/main/java/org/openhab/automation/jrubyscripting/internal/JRubyEngineWrapper.java +++ b/bundles/org.openhab.automation.jrubyscripting/src/main/java/org/openhab/automation/jrubyscripting/internal/JRubyEngineWrapper.java @@ -35,7 +35,7 @@ import org.jruby.embed.jsr223.JRubyEngine; * @author Jimmy Tanagra - Initial contribution */ @NonNullByDefault -public class JRubyEngineWrapper implements Invocable, ScriptEngine { +public class JRubyEngineWrapper implements Invocable, ScriptEngine, AutoCloseable { // Don't implement Compilable because there is a bug // in JRuby's compiled scripts: https://github.com/jruby/jruby/issues/8346 @@ -205,4 +205,9 @@ public class JRubyEngineWrapper implements Invocable, ScriptEngine { public T getInterface(@Nullable Object receiver, @Nullable Class returnType) { return engine.getInterface(receiver, returnType); } + + @Override + public void close() { + engine.close(); + } }