From 869ef8197ffd76c3a76ae00dd6b168413e105c86 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 17 Feb 2024 18:56:10 +0300 Subject: =?UTF-8?q?fixes=20#4209=20(=D0=9F=D0=B0=D0=B4=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=BF=D1=80=D0=B8=20=D0=B2=D1=8B=D0=B3=D1=80=D1=83?= =?UTF-8?q?=D0=B7=D0=BA=D0=B5=20=D0=BD=D0=B5=D0=BA=D0=BE=D1=82=D0=BE=D1=80?= =?UTF-8?q?=D1=8B=D1=85=20=D0=BF=D0=BB=D0=B0=D0=B3=D0=B8=D0=BD=D0=BE=D0=B2?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mir_app/src/miranda.h | 4 ++++ src/mir_app/src/options.cpp | 25 +++++++++++++++++++++++++ src/mir_app/src/proto_accs.cpp | 1 + 3 files changed, 30 insertions(+) (limited to 'src') diff --git a/src/mir_app/src/miranda.h b/src/mir_app/src/miranda.h index d87d66f9b5..6d12620e38 100644 --- a/src/mir_app/src/miranda.h +++ b/src/mir_app/src/miranda.h @@ -59,6 +59,10 @@ const char* GetPluginNameByInstance(HINSTANCE hInstance); int LoadStdPlugins(void); int LaunchServicePlugin(pluginEntry *p); +/**** options.cpp **********************************************************************/ + +void KillObjectOptions(PROTO_INTERFACE *p); + /**** path.cpp *************************************************************************/ void InitPathVar(void); diff --git a/src/mir_app/src/options.cpp b/src/mir_app/src/options.cpp index 2c0cada881..f0943b6c1e 100644 --- a/src/mir_app/src/options.cpp +++ b/src/mir_app/src/options.cpp @@ -1125,6 +1125,25 @@ public: } } + void KillAccount(PROTO_INTERFACE *ppro) + { + for (auto &opd : m_arOpd) { + if (opd->pDialog == nullptr) + continue; + + if (auto *pDlg = dynamic_cast(opd->pDialog)) { + if (pDlg->GetProtoInterface() == ppro) { + opd->pDialog->Close(); + opd->pDialog = nullptr; + m_arDeleted.insert(opd); + } + } + } + + if (m_arDeleted.getCount()) + m_timerRebuild.Start(50); + } + void KillModule(HPLUGIN pPlugin) { for (auto &opd : m_arOpd) { @@ -1246,6 +1265,12 @@ MIR_APP_DLL(int) Options_AddPage(WPARAM wParam, OPTIONSDIALOGPAGE *odp, HPLUGIN ///////////////////////////////////////////////////////////////////////////////////////// +void KillObjectOptions(PROTO_INTERFACE *ppro) +{ + if (pOptionsDlg != nullptr) + pOptionsDlg->KillAccount(ppro); +} + MIR_APP_DLL(void) KillModuleOptions(HPLUGIN pPlugin) { if (pOptionsDlg != nullptr) diff --git a/src/mir_app/src/proto_accs.cpp b/src/mir_app/src/proto_accs.cpp index fb39c23ed7..e0b3f02452 100644 --- a/src/mir_app/src/proto_accs.cpp +++ b/src/mir_app/src/proto_accs.cpp @@ -305,6 +305,7 @@ static void __cdecl DeactivationThread(DeactivationThreadParam *param) p->OnShutdown(); } + KillObjectOptions(p); KillObjectThreads(p); // waits for them before terminating KillObjectEventHooks(p); // untie an object from the outside world -- cgit v1.2.3