summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-12-10 19:56:36 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-12-10 19:56:36 +0300
commit4842022127002c7967f0072830a564eaf87c3f93 (patch)
tree0b5c24e7e8819e05c880baca96d14b244b7f0226
parent4e8151f2d714ebc405dac810fe6c704dddaf183a (diff)
fixes #3214 (occasional crash in tabSRMM)
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index 2257567ffe..dbf57a6c4e 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -352,6 +352,12 @@ void CMsgDialog::Init()
m_forceResizable = true;
m_bFilterEnabled = db_get_b(m_hContact, CHAT_MODULE, "FilterEnabled", m_bFilterEnabled) != 0;
+ // refresh cache data for this contact
+ m_cache = CContactCache::getContactCache(m_hContact);
+ m_cache->updateNick();
+ m_cache->updateUIN();
+
+ // events
m_btnOk.OnClick = Callback(this, &CMsgDialog::onClick_Ok);
m_message.OnChange = Callback(this, &CMsgDialog::onChange_Message);
@@ -376,6 +382,8 @@ bool CMsgDialog::OnInitDialog()
{
CSuper::OnInitDialog();
+ m_cache->setWindowData(this);
+
// m_hwnd is valid, pass it to the tab control
TCITEM tci;
tci.mask = TCIF_PARAM;
@@ -396,12 +404,6 @@ bool CMsgDialog::OnInitDialog()
// set up Windows themes
DM_ThemeChanged();
- // refresh cache data for this contact
- m_cache = CContactCache::getContactCache(m_hContact);
- m_cache->updateNick();
- m_cache->updateUIN();
- m_cache->setWindowData(this);
-
m_bIsAutosizingInput = m_pContainer->cfg.flags.m_bAutoSplitter && !m_bSplitterOverride;
m_szProto = const_cast<char *>(m_cache->getProto());
m_bIsMeta = m_cache->isMeta();