diff options
Diffstat (limited to 'scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java')
-rw-r--r-- | scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java index 2aabba71242b..76ee4eff55f7 100644 --- a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java +++ b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java @@ -49,7 +49,9 @@ import com.sun.star.uno.Any; import com.sun.star.uno.Type; import com.sun.star.uno.XComponentContext; +import java.io.IOException; import java.net.URL; +import java.net.URLClassLoader; import java.util.StringTokenizer; @@ -182,13 +184,19 @@ class ScriptImpl implements XScript { aOutParamIndex[0] = new short[0]; aOutParam[0] = new Object[0]; - ClassLoader cl = null; + URLClassLoader cl = null; URL sourceUrl = null; try { cl = ClassLoaderFactory.getURLClassLoader(metaData); sourceUrl = metaData.getSourceURL(); } catch (java.net.MalformedURLException mfu) { + if (cl != null) { + try { + cl.close(); + } catch (IOException e) { + } + } // Framework error throw new ScriptFrameworkErrorException( mfu.getMessage(), null, |