diff --git a/src/main.cpp b/src/main.cpp index 31aa327b7..65929f2b5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1296,7 +1296,15 @@ static void LoadPlugins() { } } - +/** + * @brief Unloads all the plugins that hold some resources that + * need to be deallocated. + */ +void UnloadPlugins() { + if (GloWebInterface) { + GloWebInterface->stop(); + } +} void ProxySQL_Main_init_phase2___not_started() { LoadPlugins(); @@ -1893,6 +1901,9 @@ __shutdown: proxy_info("Starting shutdown...\n"); + // First shutdown step is to unload plugins + UnloadPlugins(); + ProxySQL_Main_init_phase4___shutdown(); proxy_info("Shutdown completed!\n");