From df8583df57489ec5cf8308abf11a0024b34431d5 Mon Sep 17 00:00:00 2001 From: Vaishnav Anil Date: Fri, 25 Jun 2021 05:08:14 +0530 Subject: [PATCH] Close URLClassLoader if Expansion class was not found --- src/main/java/me/clip/placeholderapi/util/FileUtil.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/clip/placeholderapi/util/FileUtil.java b/src/main/java/me/clip/placeholderapi/util/FileUtil.java index b98770f..825ff54 100644 --- a/src/main/java/me/clip/placeholderapi/util/FileUtil.java +++ b/src/main/java/me/clip/placeholderapi/util/FileUtil.java @@ -67,8 +67,11 @@ public class FileUtil { } } } - - return classes.isEmpty() ? null : classes.get(0); + if (classes.isEmpty()) { + loader.close(); + return null; + } + return classes.get(0); } }