void pluginSetCoreclrInfo(void* hostHandle, unsigned int domainId, coreclr_create_delegate_ptr delegateFunc);
char* pluginGetDllPath();
void pluginBeforeExecute();
+void pluginFinalize();
// initialize / finalize plugin manager
int initializePluginManager(const char* mode);
void CoreRuntime::dispose()
{
- // call finalize plugin callback before shutdown coreclr
- finalizePluginManager();
+ // call plugin finalize function to notify finalize to plugin
+ // dlclose shoud be done after coreclr shutdown to avoid breaking signal chain
+ pluginFinalize();
// ignore the signal generated by an exception that occurred during shutdown
checkOnTerminate = true;
__coreclrLib = nullptr;
}
+ finalizePluginManager();
finalizePathManager();
__envList.clear();
void finalizePluginManager()
{
+ _INFO("Plugin manager finalize called");
if (__pluginFunc) {
- if (__pluginFunc->finalize) {
- __pluginFunc->finalize();
- }
free(__pluginFunc);
__pluginFunc = NULL;
}
}
}
+void pluginFinalize()
+{
+ if (__pluginFunc && __pluginFunc->finalize) {
+ __pluginFunc->finalize();
+ }
+}
+