summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2023-04-20 19:37:44 +0300
committerGeorge Hazan <ghazan@miranda.im>2023-04-20 19:37:44 +0300
commit0b305d1a7e0dbd30c7acbe5f4a93a511620df934 (patch)
tree7c48467f74dd58094c2b8061e054d52b7f75f02f /src
parent99fabf4f58d0a8dabbb8a8469fe3a81ef58b2797 (diff)
hopefully fixes #3492 (Random crashes)
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/chat_manager.cpp28
-rw-r--r--src/mir_app/src/chat_tools.cpp18
-rw-r--r--src/mir_app/src/mir_app.def2
-rw-r--r--src/mir_app/src/mir_app64.def2
4 files changed, 25 insertions, 25 deletions
diff --git a/src/mir_app/src/chat_manager.cpp b/src/mir_app/src/chat_manager.cpp
index a9772c1113..eb0de25e12 100644
--- a/src/mir_app/src/chat_manager.cpp
+++ b/src/mir_app/src/chat_manager.cpp
@@ -56,6 +56,24 @@ static int compareModules(const MODULEINFO *p1, const MODULEINFO *p2)
static LIST<MODULEINFO> g_arModules(5, compareModules);
/////////////////////////////////////////////////////////////////////////////////////////
+// LOGINFO members
+
+LOGINFO::LOGINFO(const GCEVENT *gce) :
+ ptszNick(mir_wstrdup(gce->pszNick.w)),
+ ptszText(mir_wstrdup(gce->pszText.w)),
+ ptszStatus(mir_wstrdup(gce->pszStatus.w)),
+ ptszUserInfo(mir_wstrdup(gce->pszUserInfo.w))
+{
+ time = gce->time;
+ iType = gce->iType;
+ bIsMe = gce->bIsMe;
+}
+
+LOGINFO::~LOGINFO()
+{
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
// Session Manager functions
// Keeps track of all sessions and its windows
@@ -199,8 +217,7 @@ LOGINFO* SM_AddEvent(SESSION_INFO *si, GCEVENT *gce, bool bIsHighlighted)
if (si == nullptr)
return nullptr;
- LOGINFO *li = new LOGINFO();
- li->time = gce->time;
+ LOGINFO *li = new LOGINFO(gce);
li->bIsHighlighted = bIsHighlighted;
if (si->pMI->bDatabase && gce->hEvent) {
li->hEvent = gce->hEvent;
@@ -210,13 +227,6 @@ LOGINFO* SM_AddEvent(SESSION_INFO *si, GCEVENT *gce, bool bIsHighlighted)
}
}
else li->hEvent = si->iLastEvent++;
-
- li->iType = gce->iType;
- li->ptszNick = mir_wstrdup(gce->pszNick.w);
- li->ptszText = mir_wstrdup(gce->pszText.w);
- li->ptszStatus = mir_wstrdup(gce->pszStatus.w);
- li->ptszUserInfo = mir_wstrdup(gce->pszUserInfo.w);
- li->bIsMe = gce->bIsMe;
si->arEvents.insert(li);
diff --git a/src/mir_app/src/chat_tools.cpp b/src/mir_app/src/chat_tools.cpp
index 48f5271745..50f16f07ba 100644
--- a/src/mir_app/src/chat_tools.cpp
+++ b/src/mir_app/src/chat_tools.cpp
@@ -26,20 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#pragma comment(lib, "Shlwapi.lib")
-struct fakeLOGINFO : public LOGINFO
-{
- fakeLOGINFO(const GCEVENT *gce)
- {
- bSimple = true;
- bIsMe = gce->bIsMe;
- iType = gce->iType;
- ptszText = (wchar_t *)gce->pszText.w;
- ptszNick = (wchar_t *)gce->pszNick.w;
- ptszStatus = (wchar_t *)gce->pszStatus.w;
- ptszUserInfo = (wchar_t *)gce->pszUserInfo.w;
- }
-};
-
/////////////////////////////////////////////////////////////////////////////////////////
int GetRichTextLength(HWND hwnd)
@@ -302,7 +288,7 @@ BOOL DoPopup(SESSION_INFO *si, GCEVENT *gce)
if (si == nullptr || !(si->iPopupFlags & gce->iType))
return FALSE;
- fakeLOGINFO lin(gce);
+ LOGINFO lin(gce);
CMStringW wszText, wszNick;
g_chatApi.CreateNick(si, &lin, wszNick);
bool bTextUsed = Chat_GetDefaultEventDescr(si, &lin, wszText);
@@ -508,7 +494,7 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce)
pszNick = szTemp;
}
- fakeLOGINFO lin(gce);
+ LOGINFO lin(gce);
CMStringW buf;
bool bTextUsed = Chat_GetDefaultEventDescr(si, &lin, buf);
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index 8664a4ddf2..4e24c3be80 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -858,3 +858,5 @@ Chat_IsMuted @941 NONAME
?CreateChatRtfHeader@CRtfLogWindow@@UAEXPAURtfChatLogStreamData@@@Z @975 NONAME
?CreateChatRtfTail@CRtfLogWindow@@UAEXPAURtfChatLogStreamData@@@Z @976 NONAME
?StreamChatRtfEvents@CRtfLogWindow@@QAEXPAURtfChatLogStreamData@@_N@Z @977 NONAME
+??0LOGINFO@@QAE@PBUGCEVENT@@@Z @978 NONAME
+??1LOGINFO@@QAE@XZ @979 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index de48b7f87c..1cb5054e48 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -858,3 +858,5 @@ Chat_IsMuted @941 NONAME
?CreateChatRtfHeader@CRtfLogWindow@@UEAAXPEAURtfChatLogStreamData@@@Z @975 NONAME
?CreateChatRtfTail@CRtfLogWindow@@UEAAXPEAURtfChatLogStreamData@@@Z @976 NONAME
?StreamChatRtfEvents@CRtfLogWindow@@QEAAXPEAURtfChatLogStreamData@@_N@Z @977 NONAME
+??0LOGINFO@@QEAA@PEBUGCEVENT@@@Z @978 NONAME
+??1LOGINFO@@QEAA@XZ @979 NONAME