Skip to content

Commit

Permalink
bridge: fix a resource leak in BaseScriptingEnvironment
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosame committed Aug 15, 2024
1 parent 0d78bf4 commit 4ebfde1
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -361,13 +361,13 @@ protected void loadScript(AbstractElement script) {
// Java code invocation.
//
if (type.equals(SVGConstants.SVG_SCRIPT_TYPE_JAVA)) {
DocumentJarClassLoader cll = null;
try {
String href = XLinkSupport.getXLinkHref(script);
ParsedURL purl = new ParsedURL(script.getBaseURI(), href);

checkCompatibleScriptURL(type, purl);

DocumentJarClassLoader cll;
URL docURL = null;
try {
docURL = new URL(docPURL.toString());
Expand Down Expand Up @@ -411,6 +411,15 @@ protected void loadScript(AbstractElement script) {
if (userAgent != null) {
userAgent.displayError(e);
}
} finally {
try {
if (cll != null)
cll.close();
} catch (IOException e) {
if (userAgent != null) {
userAgent.displayError(e);
}
}
}
return;
}
Expand Down

0 comments on commit 4ebfde1

Please sign in to comment.