From dc8c4db75a2cb08919e8df9d8be194661af18d5e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 1 Mar 2023 18:21:07 +0300 Subject: fixes #3373 (Scriver: crash on unload) --- src/core/stdmsg/src/msglog.cpp | 2 +- src/mir_app/src/newplugins.cpp | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp index 13d193be03..7dddbcd10f 100644 --- a/src/core/stdmsg/src/msglog.cpp +++ b/src/core/stdmsg/src/msglog.cpp @@ -439,7 +439,7 @@ void LoadMsgLogIcons(void) void FreeMsgLogIcons(void) { for (auto &it : pLogIconBmpBits) - mir_free(it); + replaceStr(it, 0); } ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/mir_app/src/newplugins.cpp b/src/mir_app/src/newplugins.cpp index 367afde7b0..d9508f7874 100644 --- a/src/mir_app/src/newplugins.cpp +++ b/src/mir_app/src/newplugins.cpp @@ -735,8 +735,15 @@ int LoadNewPluginsModule(void) SetPluginOnWhiteList(p->pluginname, plugin_clist == p); // now loop thru and load all the other plugins, do this in one pass - for (int i = 0; i < pluginList.getCount(); i++) - TryLoadPlugin(pluginList[i], false); + for (int i = 0; i < pluginList.getCount(); i++) { + auto *p = pluginList[i]; + if (!TryLoadPlugin(p, false)) { + if (!p->bFailed) { + Plugin_Uninit(p); + i--; + } + } + } for (auto &it : servicePlugins.rev_iter()) if (!IsPluginOnWhiteList(it->pluginname)) -- cgit v1.2.3