diff options
author | George Hazan <ghazan@miranda.im> | 2022-03-22 21:36:07 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-03-22 21:36:07 +0300 |
commit | 7401cfeb7d56359e96679f2fe306885ed63587f0 (patch) | |
tree | 51fd613c2e156c1ba2af7ffc541bcf6855d974ea /plugins/TabSRMM | |
parent | afab27db09a3fc0fa4c3e85b2ef4425644d1b244 (diff) |
crash fix
Diffstat (limited to 'plugins/TabSRMM')
-rw-r--r-- | plugins/TabSRMM/src/msgdialog.cpp | 3 | ||||
-rw-r--r-- | plugins/TabSRMM/src/sendqueue.cpp | 4 | ||||
-rw-r--r-- | plugins/TabSRMM/src/sendqueue.h | 10 | ||||
-rw-r--r-- | plugins/TabSRMM/src/version.h | 2 |
4 files changed, 11 insertions, 8 deletions
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 05231b3234..d008b50f8d 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -2608,7 +2608,8 @@ INT_PTR CMsgDialog::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (iIndex < SendQueue::NR_SENDJOBS) { // single sendjob timer
SendJob *job = sendQueue->getJobByIndex(iIndex);
KillTimer(m_hwnd, wParam);
- job->wszErrorMsg.Format(TranslateT("Delivery failure: %s"), TranslateT("The message send timed out"));
+
+ replaceStrW(job->pwszErrorMsg, CMStringW(FORMAT, TranslateT("Delivery failure: %s"), TranslateT("The message send timed out")));
job->iStatus = SendQueue::SQ_ERROR;
if (!NEN::bNoSounds && !m_pContainer->m_flags.m_bNoSound)
Skin_PlaySound("SendError");
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index fe850165e8..3b97e86559 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -50,7 +50,7 @@ void SendQueue::handleError(CMsgDialog *dat, const int iEntry) const if (!dat) return; dat->m_iCurrentQueueError = iEntry; - logError(dat, iEntry, m_jobs[iEntry].wszErrorMsg); + logError(dat, iEntry, m_jobs[iEntry].pwszErrorMsg); recallFailed(dat, iEntry); showErrorControls(dat, TRUE); ::HandleIconFeedback(dat, PluginConfig.g_iconErr); @@ -437,7 +437,7 @@ int SendQueue::ackMessage(CMsgDialog *dat, WPARAM wParam, LPARAM lParam) if (!NEN::bNoSounds && !dat->m_pContainer->m_flags.m_bNoSound) Skin_PlaySound("SendError"); - job.wszErrorMsg.Format(TranslateT("Delivery failure: %s"), (wchar_t*)ack->lParam); + replaceStrW(job.pwszErrorMsg, CMStringW(FORMAT, TranslateT("Delivery failure: %s"), (wchar_t*)ack->lParam)); job.iStatus = SQ_ERROR; KillTimer(dat->GetHwnd(), TIMERID_MSGSEND + iFound); if (!dat->m_bErrorState) diff --git a/plugins/TabSRMM/src/sendqueue.h b/plugins/TabSRMM/src/sendqueue.h index f2866dac18..89f32b17f8 100644 --- a/plugins/TabSRMM/src/sendqueue.h +++ b/plugins/TabSRMM/src/sendqueue.h @@ -47,7 +47,7 @@ struct SendJob MCONTACT hContact;
HWND hOwnerWnd;
unsigned iStatus;
- CMStringW wszErrorMsg;
+ wchar_t* pwszErrorMsg;
uint32_t dwFlags;
int iAcksNeeded;
HANDLE hEventSplit;
@@ -66,7 +66,7 @@ public: SendQueue()
{
- memset(m_jobs, 0, (sizeof(SendJob) * NR_SENDJOBS));
+ memset(m_jobs, 0, sizeof(m_jobs));
m_currentIndex = 0;
}
@@ -75,8 +75,10 @@ public: ~SendQueue()
{
- for (int i = 0; i < NR_SENDJOBS; i++)
- mir_free(m_jobs[i].szSendBuffer);
+ for (auto &it : m_jobs) {
+ mir_free(it.pwszErrorMsg);
+ mir_free(it.szSendBuffer);
+ }
}
SendJob *getJobByIndex(const int index) { return(&m_jobs[index]); }
diff --git a/plugins/TabSRMM/src/version.h b/plugins/TabSRMM/src/version.h index 82b20f1c15..a8da5e5fe0 100644 --- a/plugins/TabSRMM/src/version.h +++ b/plugins/TabSRMM/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 3
#define __MINOR_VERSION 6
#define __RELEASE_NUM 2
-#define __BUILD_NUM 1
+#define __BUILD_NUM 2
#include <stdver.h>
|