bukkit-runtime
bukkit-runtime copied to clipboard
Error when running /reload
The /reload builtin command doesn't work with CustomRealms plugins. The reason is complicated, but known:
- When
onLoadis called, CustomRealms plugins load the J2V8 dynamic library (native DLL/dylib bundled in the JAR file) - When
/reloadis run and the plugin is disabled, the library is not released because the ClassLoader has not been released for some reason - When
onLoadis called during the reload process, CustomRealms tries to load the J2V8 library again. However, because it has already been loaded by a ClassLoader to which the plugin has no reference, it throws an exception
We need to find a way to properly release and initialize the J2V8 runtime without leaking resources.
The bug also might lead to errors when running multiple CustomRealms plugins in the same server, but it needs to be tested.