< prev index next >

src/hotspot/share/prims/jvmtiExport.cpp

Print this page

        

@@ -2705,10 +2705,13 @@
       // If OnAttach returns JNI_OK then we add it to the list of
       // agent libraries so that we can call Agent_OnUnload later.
       if (result == JNI_OK) {
         Arguments::add_loaded_agent(agent_lib);
       } else {
+        if (!agent_lib->is_static_lib()) {
+          os::dll_unload(library);
+        }
         delete agent_lib;
       }
 
       // Agent_OnAttach executed so completion status is JNI_OK
       st->print_cr("return code: %d", result);
< prev index next >