summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-03-27 20:51:02 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-03-27 20:51:02 +0300
commit3ed57b9844b340d1732d85d76f2184498aba5609 (patch)
treed17753b7a107a413ac2594b2cdedf516b6861a20 /protocols/JabberG/src
parented499945b795b6890e26430d761012c37c432c62 (diff)
crash fix for Jabber
Diffstat (limited to 'protocols/JabberG/src')
-rwxr-xr-xprotocols/JabberG/src/jabber.cpp1
-rw-r--r--protocols/JabberG/src/jabber_icolib.cpp2
-rw-r--r--protocols/JabberG/src/jabber_icolib.h10
-rw-r--r--protocols/JabberG/src/jabber_xstatus.cpp6
-rw-r--r--protocols/JabberG/src/stdafx.h1
5 files changed, 16 insertions, 4 deletions
diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp
index ffeb046594..c6046e2b2e 100755
--- a/protocols/JabberG/src/jabber.cpp
+++ b/protocols/JabberG/src/jabber.cpp
@@ -222,6 +222,7 @@ extern "C" int __declspec(dllexport) Load()
extern "C" int __declspec(dllexport) Unload(void)
{
+ g_XstatusIconsUninit();
JabberUserInfoUninit();
if (hMsftedit != nullptr)
diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp
index 1e8bfa7b07..36302d1d3f 100644
--- a/protocols/JabberG/src/jabber_icolib.cpp
+++ b/protocols/JabberG/src/jabber_icolib.cpp
@@ -98,7 +98,7 @@ CIconPool::CPoolItem::~CPoolItem()
mir_free(m_szIcolibName);
}
- if (m_name) mir_free(m_name);
+ mir_free(m_name);
}
CIconPool::CIconPool() :
diff --git a/protocols/JabberG/src/jabber_icolib.h b/protocols/JabberG/src/jabber_icolib.h
index d30c0ea62a..e272cd7493 100644
--- a/protocols/JabberG/src/jabber_icolib.h
+++ b/protocols/JabberG/src/jabber_icolib.h
@@ -38,8 +38,12 @@ public:
void RegisterIcon(const char *name, wchar_t *filename, int iconid, wchar_t *szSection, wchar_t *szDescription);
HANDLE GetIcolibHandle(const char *name);
- char *GetIcolibName(const char *name);
- HICON GetIcon(const char *name, bool big = false);
+ char* GetIcolibName(const char *name);
+ HICON GetIcon(const char *name, bool big = false);
+
+ __forceinline void Clear()
+ { m_items.destroy();
+ }
private:
struct CPoolItem
@@ -56,7 +60,7 @@ private:
OBJLIST<CPoolItem> m_items;
- CPoolItem *FindItemByName(const char *name);
+ CPoolItem* FindItemByName(const char *name);
};
#endif // _JABBER_ICOLIB_H_
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp
index 09de8a92b6..06666c36fd 100644
--- a/protocols/JabberG/src/jabber_xstatus.cpp
+++ b/protocols/JabberG/src/jabber_xstatus.cpp
@@ -1524,3 +1524,9 @@ void g_XstatusIconsInit()
g_ActivityIcons.RegisterIcon(g_arrActivities[k].szSecond, szFile, g_arrActivities[k].iconid, szSection, TranslateW(g_arrActivities[k].szTitle));
}
}
+
+void g_XstatusIconsUninit()
+{
+ g_MoodIcons.Clear();
+ g_ActivityIcons.Clear();
+}
diff --git a/protocols/JabberG/src/stdafx.h b/protocols/JabberG/src/stdafx.h
index 6943d549e0..ca39578fe3 100644
--- a/protocols/JabberG/src/stdafx.h
+++ b/protocols/JabberG/src/stdafx.h
@@ -640,6 +640,7 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode);
void g_IconsInit();
void g_XstatusIconsInit();
+void g_XstatusIconsUninit();
HANDLE g_GetIconHandle(int iconId);
HICON g_LoadIconEx(const char* name, bool big = false);