| 36 | } |
| 37 | |
| 38 | void PluginLoader::UnLoadPlugin() { |
| 39 | if (!dynamic_lib_.IsLoaded()) return; |
| 40 | |
| 41 | if (plugin_ptr_ != nullptr) { |
| 42 | if (destroy_func_ != nullptr) { |
| 43 | ((DynlibDestroyCorePluginFunc)destroy_func_)(plugin_ptr_); |
| 44 | } else { |
| 45 | AIMRT_WARN("Destroy func is null!"); |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | destroy_func_ = nullptr; |
| 50 | dynamic_lib_.Unload(); |
| 51 | } |
| 52 | |
| 53 | } // namespace aimrt::runtime::core::plugin |