From 8445246b8f17cc8e6cd7d4de90b87ababcc5c9b6 Mon Sep 17 00:00:00 2001 From: Lijun Wang <83639177+lijunwangs@users.noreply.github.com> Date: Mon, 27 Nov 2023 13:07:26 -0800 Subject: [PATCH] Added a comment about order of dropping plugin and library (#34160) Added a comment about order of dropping plugin and library --- geyser-plugin-manager/src/geyser_plugin_manager.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/geyser-plugin-manager/src/geyser_plugin_manager.rs b/geyser-plugin-manager/src/geyser_plugin_manager.rs index 9e353b025..c90493864 100644 --- a/geyser-plugin-manager/src/geyser_plugin_manager.rs +++ b/geyser-plugin-manager/src/geyser_plugin_manager.rs @@ -221,6 +221,7 @@ impl GeyserPluginManager { let mut current_plugin = self.plugins.remove(idx); let name = current_plugin.name().to_string(); current_plugin.on_unload(); + // The plugin must be dropped before the library to avoid a crash. drop(current_plugin); drop(current_lib); info!("Unloaded plugin {name} at idx {idx}");