--- a/src/hotspot/share/classfile/classLoader.cpp Tue Dec 11 19:55:27 2018 -0800
+++ b/src/hotspot/share/classfile/classLoader.cpp Wed Dec 12 10:13:11 2018 +0530
@@ -363,6 +363,13 @@
}
}
+void ClassPathImageEntry::close_jimage() {
+ if (_jimage != NULL) {
+ (*JImageClose)(_jimage);
+ _jimage = NULL;
+ }
+}
+
ClassPathImageEntry::ClassPathImageEntry(JImageFile* jimage, const char* name) :
ClassPathEntry(),
_jimage(jimage) {
@@ -614,6 +621,12 @@
void ClassLoader::setup_module_search_path(const char* path, TRAPS) {
update_module_path_entry_list(path, THREAD);
}
+
+void ClassLoader::close_jrt_image() {
+ assert(ClassLoader::has_jrt_entry(), "Not applicable for exploded builds");
+ _jrt_entry->close_jimage();
+}
+
#endif // INCLUDE_CDS
// Construct the array of module/path pairs as specified to --patch-module