Added a comment about order of dropping plugin and library (#34160)

Added a comment about order of dropping plugin and library
This commit is contained in:
Lijun Wang 2023-11-27 13:07:26 -08:00 committed by GitHub
parent a22487f444
commit 8445246b8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -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}");