From 7f8875c0261a2daeec14235223d66b4e2aeda3c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jaramago=20Fern=C3=A1ndez?= Date: Mon, 12 Oct 2020 21:01:45 +0200 Subject: [PATCH] Added new shutdown phase 'UnloadPlugins' to fix GloWebInterface deinitialization - Added new function 'UnloadPlugins' to unload plugins that require de-initialization. - 'GloWebInterface' plugin is now stopped during this phase. --- src/main.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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");