summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-01-02 20:20:47 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-01-02 20:20:47 +0000
commit8712f0c3591941711f8407fc069a1fbd98efbd65 (patch)
treec75825bc3d05f543e622770c684e09113ddbeb79
parentad5dee8e7d01ea0cd2b96a7f46e1f6fc9692825a (diff)
added destructor LIST::~LIST, that calls destroy() automatically.
thus manual call of destroy() might be removed from: - class destructors; - Unload() plugin's functions (for global data); - local (auto) variables in functions finalizations git-svn-id: http://svn.miranda-ng.org/main/trunk@7467 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--include/m_system_cpp.h32
-rw-r--r--plugins/AVS/src/main.cpp3
-rw-r--r--plugins/CSList/src/cslist.cpp1
-rw-r--r--plugins/Clist_modern/src/modern_aniavatars.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_awaymsg.cpp1
-rw-r--r--plugins/Clist_modern/src/modern_clcitems.cpp3
-rw-r--r--plugins/Clist_nicer/src/clc.cpp1
-rw-r--r--plugins/Db3x_mmap/src/dbintf.cpp4
-rw-r--r--plugins/Db3x_mmap/src/init.cpp1
-rw-r--r--plugins/Dbx_mmap_SA/src/init.cpp1
-rw-r--r--plugins/FingerprintNG/src/fingerprint.cpp5
-rw-r--r--plugins/FingerprintNG/src/global.h1
-rw-r--r--plugins/FingerprintNG/src/main.cpp1
-rw-r--r--plugins/Popup/src/actions.cpp2
-rw-r--r--plugins/SeenPlugin/src/main.cpp1
-rw-r--r--plugins/SmileyAdd/src/AniSmileyObject.cpp1
-rw-r--r--plugins/SmileyAdd/src/SmileyBase.cpp6
-rw-r--r--plugins/SmileyAdd/src/general.h1
-rw-r--r--plugins/SmileyAdd/src/main.cpp2
-rw-r--r--plugins/SmileyAdd/src/services.cpp3
-rw-r--r--plugins/TabSRMM/src/sendlater.cpp2
-rw-r--r--plugins/TopToolBar/src/toolbar.cpp1
-rw-r--r--plugins/TopToolBar/src/ttbopt.cpp1
-rw-r--r--plugins/UserInfoEx/src/dlg_propsheet.cpp3
-rw-r--r--plugins/UserInfoEx/src/mir_contactqueue.cpp3
-rw-r--r--plugins/UserInfoEx/src/mir_db.cpp1
-rw-r--r--plugins/Variables/src/parse_alias.cpp2
-rw-r--r--plugins/YAPP/src/services.cpp1
-rw-r--r--protocols/AimOscar/src/proto.cpp2
-rw-r--r--protocols/FacebookRM/src/main.cpp2
-rw-r--r--protocols/GTalkExt/src/GTalkExt.cpp1
-rw-r--r--protocols/Gadu-Gadu/src/gg.cpp3
-rw-r--r--protocols/Gadu-Gadu/src/oauth.cpp2
-rw-r--r--protocols/IRCG/src/ircproto.cpp3
-rw-r--r--protocols/IRCG/src/main.cpp3
-rw-r--r--protocols/IRCG/src/ui_utils.cpp3
-rw-r--r--protocols/IcqOscarJ/src/icq_proto.cpp2
-rw-r--r--protocols/IcqOscarJ/src/init.cpp2
-rw-r--r--protocols/JabberG/src/jabber.cpp2
-rw-r--r--protocols/JabberG/src/jabber_form.cpp1
-rw-r--r--protocols/JabberG/src/jabber_iqid.cpp4
-rw-r--r--protocols/JabberG/src/jabber_list.cpp1
-rw-r--r--protocols/JabberG/src/jabber_notes.cpp2
-rw-r--r--protocols/JabberG/src/jabber_opttree.cpp1
-rw-r--r--protocols/JabberG/src/jabber_privacy.cpp2
-rw-r--r--protocols/JabberG/src/jabber_proto.cpp3
-rw-r--r--protocols/JabberG/src/jabber_thread.cpp4
-rw-r--r--protocols/JabberG/src/jabber_treelist.cpp10
-rw-r--r--protocols/JabberG/src/ui_utils.cpp3
-rw-r--r--protocols/MRA/src/Mra.cpp1
-rw-r--r--protocols/MSN/src/msn_srv.cpp5
-rw-r--r--protocols/Omegle/src/main.cpp2
-rw-r--r--protocols/Skype/src/skype_proto.cpp2
-rw-r--r--protocols/SkypeClassic/src/gchat.cpp4
-rw-r--r--protocols/Yahoo/src/main.cpp1
-rw-r--r--protocols/Yahoo/src/proto.cpp4
-rw-r--r--src/core/modules.cpp2
-rw-r--r--src/mir_core/langpack.cpp1
-rw-r--r--src/mir_core/miranda.cpp1
-rw-r--r--src/mir_core/miranda.h2
-rw-r--r--src/mir_core/modules.cpp4
-rw-r--r--src/mir_core/subclass.cpp5
-rw-r--r--src/modules/button/button.cpp11
-rw-r--r--src/modules/clist/clistmod.cpp1
-rw-r--r--src/modules/clist/genmenu.cpp2
-rw-r--r--src/modules/clist/movetogroup.cpp5
-rw-r--r--src/modules/crypt/encrypt.cpp1
-rw-r--r--src/modules/database/dbintf.cpp5
-rw-r--r--src/modules/database/dbutils.cpp3
-rw-r--r--src/modules/database/mdatabasecache.cpp3
-rw-r--r--src/modules/extraicons/ExtraIconGroup.cpp1
-rw-r--r--src/modules/extraicons/extraicons.cpp7
-rw-r--r--src/modules/extraicons/options_ei.cpp5
-rw-r--r--src/modules/icolib/skin2icons.cpp4
-rw-r--r--src/modules/netlib/netlib.cpp5
-rw-r--r--src/modules/netlib/netlibautoproxy.cpp1
-rw-r--r--src/modules/options/filter.h6
-rw-r--r--src/modules/plugins/newplugins.cpp4
-rw-r--r--src/modules/protocols/protoaccs.cpp6
-rw-r--r--src/modules/protocols/protocols.cpp4
-rw-r--r--src/modules/skin/hotkeys.cpp1
-rw-r--r--src/modules/skin/sounds.cpp2
-rw-r--r--src/modules/srmm/statusicon.cpp1
-rw-r--r--src/modules/utils/timezones.cpp6
-rw-r--r--src/modules/utils/utils.cpp2
85 files changed, 41 insertions, 221 deletions
diff --git a/include/m_system_cpp.h b/include/m_system_cpp.h
index e06e0f12df..b50449b526 100644
--- a/include/m_system_cpp.h
+++ b/include/m_system_cpp.h
@@ -124,35 +124,41 @@ template<class T> struct LIST
sortFunc = FTSortFunc(id);
}
- __inline T* operator[](int idx) const { return (idx >= 0 && idx < count) ? items[idx] : NULL; }
- __inline int getCount(void) const { return count; }
- __inline T** getArray(void) const { return items; }
-
__inline LIST(const LIST& x)
- { items = NULL;
+ {
+ items = NULL;
List_Copy((SortedList*)&x, (SortedList*)this, sizeof(T));
}
__inline LIST& operator = (const LIST& x)
- { destroy();
+ {
+ destroy();
List_Copy((SortedList*)&x, (SortedList*)this, sizeof(T));
return *this;
}
+ __inline ~LIST()
+ {
+ destroy();
+ }
+
+ __inline T* operator[](int idx) const { return (idx >= 0 && idx < count) ? items[idx] : NULL; }
+ __inline int getCount(void) const { return count; }
+ __inline T** getArray(void) const { return items; }
+
__inline int getIndex(T *p) const
{ int idx;
return ( !List_GetIndex((SortedList*)this, p, &idx)) ? -1 : idx;
}
__inline void destroy(void) { List_Destroy((SortedList*)this); }
+ __inline T* find(T *p) { return (T*)List_Find((SortedList*)this, p); }
+ __inline int indexOf(T *p) { return List_IndexOf((SortedList*)this, p); }
+ __inline int insert(T *p, int idx) { return List_Insert((SortedList*)this, p, idx); }
+ __inline int remove(int idx) { return List_Remove((SortedList*)this, idx); }
- __inline T* find(T *p) { return (T*)List_Find((SortedList*)this, p); }
- __inline int indexOf(T *p) { return List_IndexOf((SortedList*)this, p); }
- __inline int insert(T *p, int idx) { return List_Insert((SortedList*)this, p, idx); }
- __inline int remove(int idx) { return List_Remove((SortedList*)this, idx); }
-
- __inline int insert(T *p) { return List_InsertPtr((SortedList*)this, p); }
- __inline int remove(T *p) { return List_RemovePtr((SortedList*)this, p); }
+ __inline int insert(T *p) { return List_InsertPtr((SortedList*)this, p); }
+ __inline int remove(T *p) { return List_RemovePtr((SortedList*)this, p); }
__inline void put(int idx, T *p) { items[idx] = p; }
diff --git a/plugins/AVS/src/main.cpp b/plugins/AVS/src/main.cpp
index 5c4c050b3f..591ac7a693 100644
--- a/plugins/AVS/src/main.cpp
+++ b/plugins/AVS/src/main.cpp
@@ -467,9 +467,6 @@ extern "C" int __declspec(dllexport) Unload(void)
UninitPolls();
UnloadCache();
- g_ProtoPictures.destroy();
- g_MyAvatars.destroy();
-
DestroyHookableEvent(hEventChanged);
DestroyHookableEvent(hEventContactAvatarChanged);
DestroyHookableEvent(hMyAvatarChanged);
diff --git a/plugins/CSList/src/cslist.cpp b/plugins/CSList/src/cslist.cpp
index 4edddb051e..cb41658ae4 100644
--- a/plugins/CSList/src/cslist.cpp
+++ b/plugins/CSList/src/cslist.cpp
@@ -158,7 +158,6 @@ extern "C" __declspec(dllexport) int Load()
extern "C" __declspec(dllexport) int Unload()
{
- arWindows.destroy();
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_aniavatars.cpp b/plugins/Clist_modern/src/modern_aniavatars.cpp
index d241ea1565..62d8422a90 100644
--- a/plugins/Clist_modern/src/modern_aniavatars.cpp
+++ b/plugins/Clist_modern/src/modern_aniavatars.cpp
@@ -239,7 +239,6 @@ int AniAva_UnloadModule()
_AniAva_DestroyAvatarWindow(s_Objects[i]->hWindow);
mir_free(s_Objects[i]);
}
- s_Objects.destroy();
for (i=0; i < s_AniAvatarList.getCount(); i++) {
ANIAVA_INFO *aai = s_AniAvatarList[i];
@@ -247,7 +246,6 @@ int AniAva_UnloadModule()
free(aai->pFrameDelays);
mir_free(aai);
}
- s_AniAvatarList.destroy();
_AniAva_RemoveAniAvaDC();
SetEvent(s_hExitEvent);
diff --git a/plugins/Clist_modern/src/modern_awaymsg.cpp b/plugins/Clist_modern/src/modern_awaymsg.cpp
index 6801f182b1..934db73c7f 100644
--- a/plugins/Clist_modern/src/modern_awaymsg.cpp
+++ b/plugins/Clist_modern/src/modern_awaymsg.cpp
@@ -173,5 +173,4 @@ void UninitAwayMsgModule()
CloseHandle(hamProcessEvent);
DeleteCriticalSection(&amCS);
- amItems.destroy();
}
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp
index 5b16bfc044..e324bbdc5f 100644
--- a/plugins/Clist_modern/src/modern_clcitems.cpp
+++ b/plugins/Clist_modern/src/modern_clcitems.cpp
@@ -579,8 +579,6 @@ void cli_SaveStateAndRebuildList(HWND hwnd, ClcData *dat)
}
group->scanIndex++;
}
- savedGroup.destroy();
- savedContact.destroy();
for (i=0; i < savedInfo.getCount(); i++) {
if (savedInfo[i].parentId == -1)
@@ -593,7 +591,6 @@ void cli_SaveStateAndRebuildList(HWND hwnd, ClcData *dat)
j = pcli->pfnAddInfoItemToGroup(group, savedInfo[i].contact.flags, _T(""));
*group->cl.items[j] = savedInfo[i].contact;
}
- savedInfo.destroy();
LOCK_RECALC_SCROLLBAR = FALSE;
pcli->pfnRecalculateGroupCheckboxes(hwnd, dat);
diff --git a/plugins/Clist_nicer/src/clc.cpp b/plugins/Clist_nicer/src/clc.cpp
index f3a5455dc6..91bcc34b79 100644
--- a/plugins/Clist_nicer/src/clc.cpp
+++ b/plugins/Clist_nicer/src/clc.cpp
@@ -200,7 +200,6 @@ int ClcShutdown(WPARAM wParam, LPARAM lParam)
IMG_DeleteItems();
for (int i=0; i < arStatusItems.getCount(); i++)
mir_free(arStatusItems[i]);
- arStatusItems.destroy();
return 0;
}
diff --git a/plugins/Db3x_mmap/src/dbintf.cpp b/plugins/Db3x_mmap/src/dbintf.cpp
index c595371fae..0efc944518 100644
--- a/plugins/Db3x_mmap/src/dbintf.cpp
+++ b/plugins/Db3x_mmap/src/dbintf.cpp
@@ -66,12 +66,8 @@ CDb3Base::CDb3Base(const TCHAR *tszFileName) :
CDb3Base::~CDb3Base()
{
- m_lResidentSettings.destroy();
-
// destroy modules
HeapDestroy(m_hModHeap);
- m_lMods.destroy();
- m_lOfs.destroy();
// destroy map
KillTimer(NULL, m_flushBuffersTimerId);
diff --git a/plugins/Db3x_mmap/src/init.cpp b/plugins/Db3x_mmap/src/init.cpp
index 605a303623..461b64be1d 100644
--- a/plugins/Db3x_mmap/src/init.cpp
+++ b/plugins/Db3x_mmap/src/init.cpp
@@ -134,7 +134,6 @@ extern "C" __declspec(dllexport) int Load(void)
extern "C" __declspec(dllexport) int Unload(void)
{
- g_Dbs.destroy();
return 0;
}
diff --git a/plugins/Dbx_mmap_SA/src/init.cpp b/plugins/Dbx_mmap_SA/src/init.cpp
index 5501e29b64..64c73d981a 100644
--- a/plugins/Dbx_mmap_SA/src/init.cpp
+++ b/plugins/Dbx_mmap_SA/src/init.cpp
@@ -141,7 +141,6 @@ extern "C" __declspec(dllexport) int Load(void)
extern "C" __declspec(dllexport) int Unload(void)
{
- g_Dbs.destroy();
UnloadSecurity();
return 0;
}
diff --git a/plugins/FingerprintNG/src/fingerprint.cpp b/plugins/FingerprintNG/src/fingerprint.cpp
index 04bd1a5f07..63683d92d0 100644
--- a/plugins/FingerprintNG/src/fingerprint.cpp
+++ b/plugins/FingerprintNG/src/fingerprint.cpp
@@ -954,8 +954,3 @@ void InitFingerModule()
CreateServiceFunction(MS_FP_GETCLIENTDESCRW, ServiceGetClientDescrW);
CreateServiceFunction(MS_FP_GETCLIENTICONW, ServiceGetClientIconW);
}
-
-void UninitFingerModule()
-{
- arMonitoredWindows.destroy();
-}
diff --git a/plugins/FingerprintNG/src/global.h b/plugins/FingerprintNG/src/global.h
index 8476fde883..40fc2fdf15 100644
--- a/plugins/FingerprintNG/src/global.h
+++ b/plugins/FingerprintNG/src/global.h
@@ -131,7 +131,6 @@ typedef struct _foundInfo
void ClearFI();
void InitFingerModule(void);
-void UninitFingerModule(void);
int OnOptInitialise(WPARAM wParam, LPARAM lParam);
int OnExtraImageApply(WPARAM wParam, LPARAM lParam);
diff --git a/plugins/FingerprintNG/src/main.cpp b/plugins/FingerprintNG/src/main.cpp
index 8415390044..423aecfc59 100644
--- a/plugins/FingerprintNG/src/main.cpp
+++ b/plugins/FingerprintNG/src/main.cpp
@@ -70,6 +70,5 @@ extern "C" int __declspec(dllexport) Unload()
{
HeapDestroy(hHeap);
ClearFI();
- UninitFingerModule();
return 0;
}
diff --git a/plugins/Popup/src/actions.cpp b/plugins/Popup/src/actions.cpp
index 28b9a781f2..c6ff944088 100644
--- a/plugins/Popup/src/actions.cpp
+++ b/plugins/Popup/src/actions.cpp
@@ -272,8 +272,6 @@ INT_PTR CALLBACK DlgProcPopupActions(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
ListView_SetItemState(hwndList, i, (gActions[i]->flags & PAF_ENABLED) ? 0x2000 : 0x1000, LVIS_STATEIMAGEMASK);
}
- groups.destroy();
-
BOOL enabled = (PopupOptions.actions&ACT_ENABLE) ? TRUE : FALSE;
for (i = 0; i < SIZEOF(controls); ++i)
EnableWindow(GetDlgItem(hwnd, controls[i]), enabled);
diff --git a/plugins/SeenPlugin/src/main.cpp b/plugins/SeenPlugin/src/main.cpp
index 01a031333a..d12a3922a1 100644
--- a/plugins/SeenPlugin/src/main.cpp
+++ b/plugins/SeenPlugin/src/main.cpp
@@ -111,7 +111,6 @@ extern "C" __declspec(dllexport) int Unload(void)
if (ehmissed)
UnhookEvent(ehmissed);
- arContacts.destroy();
DeleteCriticalSection(&csContacts);
CloseHandle(g_hShutdownEvent);
return 0;
diff --git a/plugins/SmileyAdd/src/AniSmileyObject.cpp b/plugins/SmileyAdd/src/AniSmileyObject.cpp
index 0b54d08968..0e7d0e9594 100644
--- a/plugins/SmileyAdd/src/AniSmileyObject.cpp
+++ b/plugins/SmileyAdd/src/AniSmileyObject.cpp
@@ -415,6 +415,5 @@ void DestroyAniSmileys(void)
for (int i=0; i < regAniSmileys.getCount(); i++)
delete regAniSmileys[i];
- regAniSmileys.destroy();
}
diff --git a/plugins/SmileyAdd/src/SmileyBase.cpp b/plugins/SmileyAdd/src/SmileyBase.cpp
index 94f89961de..b2d496c347 100644
--- a/plugins/SmileyAdd/src/SmileyBase.cpp
+++ b/plugins/SmileyAdd/src/SmileyBase.cpp
@@ -380,9 +380,3 @@ int CheckForTip(int x, int y, HWND hwnd, TCHAR** smltxt)
return -1;
}
-
-void DestroySmileyBase(void)
-{
- regSmileys.destroy();
-}
-
diff --git a/plugins/SmileyAdd/src/general.h b/plugins/SmileyAdd/src/general.h
index 8bd96c3eb9..489bd06b3a 100644
--- a/plugins/SmileyAdd/src/general.h
+++ b/plugins/SmileyAdd/src/general.h
@@ -186,7 +186,6 @@ void ProcessAllInputAreas(bool restoreText);
void RichEditData_Destroy(void);
void CloseSmileys(void);
-void DestroySmileyBase(void);
void DestroyAniSmileys(void);
void UrlDecode(char* str);
diff --git a/plugins/SmileyAdd/src/main.cpp b/plugins/SmileyAdd/src/main.cpp
index ff989721a0..7279cfac60 100644
--- a/plugins/SmileyAdd/src/main.cpp
+++ b/plugins/SmileyAdd/src/main.cpp
@@ -135,7 +135,6 @@ extern "C" __declspec(dllexport) int Unload(void)
RichEditData_Destroy();
DestroyAniSmileys();
- DestroySmileyBase();
g_SmileyCategories.ClearAll();
g_SmileyPackCStore.ClearAndFreeAll();
@@ -144,7 +143,6 @@ extern "C" __declspec(dllexport) int Unload(void)
DestroyGdiPlus();
DownloadClose();
- menuHandleArray.destroy();
mir_free(metaProtoName);
return 0;
diff --git a/plugins/SmileyAdd/src/services.cpp b/plugins/SmileyAdd/src/services.cpp
index f42e23978b..00f27437c6 100644
--- a/plugins/SmileyAdd/src/services.cpp
+++ b/plugins/SmileyAdd/src/services.cpp
@@ -362,8 +362,7 @@ INT_PTR CustomCatMenu(WPARAM wParam, LPARAM lParam)
SmileyCategoryType* smct = g_SmileyCategories.GetSmileyCategory((unsigned)lParam - 3);
if (smct != NULL)
opt.WriteContactCategory(hContact, smct->GetName());
- else
- {
+ else {
CMString empty;
if (lParam == 1) empty = _T("<None>");
opt.WriteContactCategory(hContact, empty);
diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp
index e3d1122171..8b6e673db2 100644
--- a/plugins/TabSRMM/src/sendlater.cpp
+++ b/plugins/TabSRMM/src/sendlater.cpp
@@ -291,7 +291,7 @@ void CSendLater::processContacts()
{
if (m_fAvail && m_sendLaterContactList.getCount() != 0) {
for (int i=0; i < m_sendLaterContactList.getCount(); i++)
- processSingleContact( m_sendLaterContactList[i]);
+ processSingleContact(m_sendLaterContactList[i]);
m_sendLaterContactList.destroy();
}
diff --git a/plugins/TopToolBar/src/toolbar.cpp b/plugins/TopToolBar/src/toolbar.cpp
index 91ac69c16c..278c4ec7c0 100644
--- a/plugins/TopToolBar/src/toolbar.cpp
+++ b/plugins/TopToolBar/src/toolbar.cpp
@@ -716,7 +716,6 @@ int UnloadToolbarModule()
for (int i=0; i < Buttons.getCount(); i++)
delete Buttons[i];
- Buttons.destroy();
mir_free(g_ctrl);
return 0;
diff --git a/plugins/TopToolBar/src/ttbopt.cpp b/plugins/TopToolBar/src/ttbopt.cpp
index 3c86fca869..e3f38e54fc 100644
--- a/plugins/TopToolBar/src/ttbopt.cpp
+++ b/plugins/TopToolBar/src/ttbopt.cpp
@@ -98,7 +98,6 @@ static void SaveTree(HWND hwndDlg)
delete Buttons[i];
Buttons = tmpList;
- tmpList.destroy();
}
SaveAllButtonsOptions();
}
diff --git a/plugins/UserInfoEx/src/dlg_propsheet.cpp b/plugins/UserInfoEx/src/dlg_propsheet.cpp
index 0892a74f24..9f6f8eb700 100644
--- a/plugins/UserInfoEx/src/dlg_propsheet.cpp
+++ b/plugins/UserInfoEx/src/dlg_propsheet.cpp
@@ -82,9 +82,6 @@ CPsHdr::~CPsHdr()
// delete data
for (int i = 0 ; i < _ignore.getCount(); i++)
mir_free(_ignore[i]);
-
- // delete the list
- _ignore.destroy();
}
void CPsHdr::Free_pPages()
diff --git a/plugins/UserInfoEx/src/mir_contactqueue.cpp b/plugins/UserInfoEx/src/mir_contactqueue.cpp
index d6d910a4fe..00c612295d 100644
--- a/plugins/UserInfoEx/src/mir_contactqueue.cpp
+++ b/plugins/UserInfoEx/src/mir_contactqueue.cpp
@@ -75,7 +75,6 @@ CContactQueue::~CContactQueue()
{
mir_free(_queue[i]);
}
- _queue.destroy();
CloseHandle(_hEvent);
DeleteCriticalSection(&_cs);
@@ -111,9 +110,7 @@ void CContactQueue::RemoveAll()
Lock();
for (int i = _queue.getCount() - 1; i >= 0; --i)
- {
mir_free(_queue[i]);
- }
_queue.destroy();
Release();
diff --git a/plugins/UserInfoEx/src/mir_db.cpp b/plugins/UserInfoEx/src/mir_db.cpp
index 9b8a8a2798..9243a317fd 100644
--- a/plugins/UserInfoEx/src/mir_db.cpp
+++ b/plugins/UserInfoEx/src/mir_db.cpp
@@ -860,7 +860,6 @@ CEnumList::~CEnumList()
if (p)
mir_free(p);
}
- destroy();
}
LPSTR CEnumList::Insert(LPCSTR str)
diff --git a/plugins/Variables/src/parse_alias.cpp b/plugins/Variables/src/parse_alias.cpp
index 485b028634..403bc2a7a0 100644
--- a/plugins/Variables/src/parse_alias.cpp
+++ b/plugins/Variables/src/parse_alias.cpp
@@ -208,6 +208,4 @@ void unregisterAliasTokens()
mir_free(p->szTranslation);
delete p;
}
-
- arAliases.destroy();
}
diff --git a/plugins/YAPP/src/services.cpp b/plugins/YAPP/src/services.cpp
index 2dd4d83332..3c8e2557c6 100644
--- a/plugins/YAPP/src/services.cpp
+++ b/plugins/YAPP/src/services.cpp
@@ -448,5 +448,4 @@ void DeinitServices()
for (int i = 0; i < arClasses.getCount(); i++)
FreePopupClass(arClasses[i]);
- arClasses.destroy();
}
diff --git a/protocols/AimOscar/src/proto.cpp b/protocols/AimOscar/src/proto.cpp
index a18ca749d0..ebe3659655 100644
--- a/protocols/AimOscar/src/proto.cpp
+++ b/protocols/AimOscar/src/proto.cpp
@@ -94,8 +94,6 @@ CAimProto::~CAimProto()
CloseHandle(hChatNavEvent);
CloseHandle(hAdminEvent);
- ft_list.destroy();
-
for (int i=0; i<9; ++i)
mir_free(modeMsgs[i]);
diff --git a/protocols/FacebookRM/src/main.cpp b/protocols/FacebookRM/src/main.cpp
index f960c9475e..b480de9be6 100644
--- a/protocols/FacebookRM/src/main.cpp
+++ b/protocols/FacebookRM/src/main.cpp
@@ -129,7 +129,5 @@ extern "C" int __declspec(dllexport) Unload(void)
for(size_t i=0; i<SIZEOF(g_hEvents); i++)
UnhookEvent(g_hEvents[i]);
- g_Instances.destroy();
-
return 0;
}
diff --git a/protocols/GTalkExt/src/GTalkExt.cpp b/protocols/GTalkExt/src/GTalkExt.cpp
index ab4a13bfa2..8b486e0cc6 100644
--- a/protocols/GTalkExt/src/GTalkExt.cpp
+++ b/protocols/GTalkExt/src/GTalkExt.cpp
@@ -101,7 +101,6 @@ extern "C" int __declspec(dllexport) Load(void)
extern "C" int __declspec(dllexport) Unload(void)
{
- g_accs.destroy();
InitAvaUnit(FALSE);
return 0;
}
diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp
index 1b70719699..8c102df7a8 100644
--- a/protocols/Gadu-Gadu/src/gg.cpp
+++ b/protocols/Gadu-Gadu/src/gg.cpp
@@ -359,9 +359,6 @@ extern "C" int __declspec(dllexport) Load(void)
extern "C" int __declspec(dllexport) Unload()
{
- g_Instances.destroy();
-
- // Cleanup WinSock
WSACleanup();
return 0;
}
diff --git a/protocols/Gadu-Gadu/src/oauth.cpp b/protocols/Gadu-Gadu/src/oauth.cpp
index 4b6f07e295..41babda221 100644
--- a/protocols/Gadu-Gadu/src/oauth.cpp
+++ b/protocols/Gadu-Gadu/src/oauth.cpp
@@ -261,7 +261,6 @@ char *oauth_auth_header(const char *httpmethod, const char *url, OAUTHSIGNMETHOD
if (oauth_sign_request(oauth_parameters, httpmethod, url, consumer_secret, token_secret)) {
oauth_freeparams(oauth_parameters);
- oauth_parameters.destroy();
return NULL;
}
@@ -285,7 +284,6 @@ char *oauth_auth_header(const char *httpmethod, const char *url, OAUTHSIGNMETHOD
}
oauth_freeparams(oauth_parameters);
- oauth_parameters.destroy();
return res;
}
diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp
index 6d779a4b39..f50b074a4f 100644
--- a/protocols/IRCG/src/ircproto.cpp
+++ b/protocols/IRCG/src/ircproto.cpp
@@ -152,9 +152,6 @@ CIrcProto::~CIrcProto()
Netlib_CloseHandle(m_hNetlibUser); m_hNetlibUser = NULL;
Netlib_CloseHandle(hNetlibDCC); hNetlibDCC = NULL;
- m_dcc_chats.destroy();
- m_dcc_xfers.destroy();
-
DeleteCriticalSection( &cs );
DeleteCriticalSection( &m_gchook );
diff --git a/protocols/IRCG/src/main.cpp b/protocols/IRCG/src/main.cpp
index 88f151671b..77024b358c 100644
--- a/protocols/IRCG/src/main.cpp
+++ b/protocols/IRCG/src/main.cpp
@@ -112,8 +112,5 @@ extern "C" int __declspec(dllexport) Unload(void)
{
UninitContactMenus();
UninitTimers();
-
- g_Instances.destroy();
-
return 0;
}
diff --git a/protocols/IRCG/src/ui_utils.cpp b/protocols/IRCG/src/ui_utils.cpp
index b86263dbfd..2e6943b123 100644
--- a/protocols/IRCG/src/ui_utils.cpp
+++ b/protocols/IRCG/src/ui_utils.cpp
@@ -38,9 +38,6 @@ CDlgBase::CDlgBase(int idDialog, HWND hwndParent) :
CDlgBase::~CDlgBase()
{
- // remove handlers
- m_controls.destroy();
-
if (m_hwnd)
DestroyWindow(m_hwnd);
}
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp
index 1d81751d16..9525e9c16d 100644
--- a/protocols/IcqOscarJ/src/icq_proto.cpp
+++ b/protocols/IcqOscarJ/src/icq_proto.cpp
@@ -237,8 +237,6 @@ CIcqProto::~CIcqProto()
DestroyHookableEvent(m_modeMsgsEvent);
// Clean-up remaining protocol instance members
- cookies.destroy();
-
UninitContactsCache();
CustomCapList.clear();
diff --git a/protocols/IcqOscarJ/src/init.cpp b/protocols/IcqOscarJ/src/init.cpp
index 525652c1d1..d57150c923 100644
--- a/protocols/IcqOscarJ/src/init.cpp
+++ b/protocols/IcqOscarJ/src/init.cpp
@@ -127,8 +127,6 @@ extern "C" int __declspec(dllexport) Unload(void)
{
// destroying contact menu
g_MenuUninit();
-
- g_Instances.destroy();
return 0;
}
diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp
index da5465fa19..89bc5e6667 100644
--- a/protocols/JabberG/src/jabber.cpp
+++ b/protocols/JabberG/src/jabber.cpp
@@ -230,7 +230,5 @@ extern "C" int __declspec(dllexport) Unload(void)
DestroyHookableEvent(hDiscoInfoResult);
g_MenuUninit();
-
- g_Instances.destroy();
return 0;
}
diff --git a/protocols/JabberG/src/jabber_form.cpp b/protocols/JabberG/src/jabber_form.cpp
index 4eb225a303..d1b8abef1c 100644
--- a/protocols/JabberG/src/jabber_form.cpp
+++ b/protocols/JabberG/src/jabber_form.cpp
@@ -580,7 +580,6 @@ void JabberFormDestroyUI(HWND hwndStatic)
if (controls) {
for (int i=0; i < controls->getCount(); i++)
mir_free((*controls)[i]);
- controls->destroy();
delete controls;
SetWindowLongPtr(hwndStatic, GWLP_USERDATA, 0);
}
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp
index 99c00a5a18..1e91e3f71f 100644
--- a/protocols/JabberG/src/jabber_iqid.cpp
+++ b/protocols/JabberG/src/jabber_iqid.cpp
@@ -154,8 +154,6 @@ void CJabberProto::OnProcessLoginRq(ThreadData* info, DWORD rq)
mir_free(nick);
}
}
-
- ll.destroy();
}
OnProcessLoginRq(info, JABBER_LOGIN_BOOKMARKS_AJ);
@@ -520,8 +518,6 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo)
for (i=0; i < chatRooms.getCount(); i++)
GroupchatJoinByHContact((HANDLE)chatRooms[i], true);
- chatRooms.destroy();
-
//UI_SAFE_NOTIFY(m_pDlgJabberJoinGroupchat, WM_JABBER_CHECK_ONLINE);
//UI_SAFE_NOTIFY(m_pDlgBookmarks, WM_JABBER_CHECK_ONLINE);
UI_SAFE_NOTIFY_HWND(m_hwndJabberAddBookmark, WM_JABBER_CHECK_ONLINE);
diff --git a/protocols/JabberG/src/jabber_list.cpp b/protocols/JabberG/src/jabber_list.cpp
index 5f84a793cd..2151448359 100644
--- a/protocols/JabberG/src/jabber_list.cpp
+++ b/protocols/JabberG/src/jabber_list.cpp
@@ -39,7 +39,6 @@ JABBER_LIST_ITEM::~JABBER_LIST_ITEM()
{
for (int i=0; i < arResources.getCount(); i++)
delete arResources[i];
- arResources.destroy();
if (m_pItemResource)
delete m_pItemResource;
diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp
index 460a4afe1d..b175ac90ed 100644
--- a/protocols/JabberG/src/jabber_notes.cpp
+++ b/protocols/JabberG/src/jabber_notes.cpp
@@ -514,8 +514,6 @@ private:
if ( !selected)
m_tvFilter.SelectItem(htiRoot);
-
- tagSet.destroy();
}
void RebuildTree()
diff --git a/protocols/JabberG/src/jabber_opttree.cpp b/protocols/JabberG/src/jabber_opttree.cpp
index 498c66c0b3..5490fa1aaf 100644
--- a/protocols/JabberG/src/jabber_opttree.cpp
+++ b/protocols/JabberG/src/jabber_opttree.cpp
@@ -38,7 +38,6 @@ CCtrlTreeOpts::~CCtrlTreeOpts()
{
for (int i=0; i < m_options.getCount(); i++)
delete m_options[i];
- m_options.destroy();
}
void CCtrlTreeOpts::AddOption(TCHAR *szOption, CMOption<BYTE> &option)
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp
index a70c6de060..5504d2689e 100644
--- a/protocols/JabberG/src/jabber_privacy.cpp
+++ b/protocols/JabberG/src/jabber_privacy.cpp
@@ -650,7 +650,6 @@ protected:
mir_free(newJids[i]->jid);
mir_free(newJids[i]);
}
- newJids.destroy();
}
void addJid(HANDLE hItem, TCHAR *jid)
@@ -2112,6 +2111,7 @@ void CJabberProto::BuildPrivacyListsMenu(bool bDeleteOld)
if (bDeleteOld)
for (int i=0; i < m_hPrivacyMenuItems.getCount(); i++)
CallService(MO_REMOVEMENUITEM, (WPARAM)m_hPrivacyMenuItems[i], 0);
+
m_hPrivacyMenuItems.destroy();
mir_cslock lck(m_privacyListManager.m_cs);
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index c47cf3eb90..f73fe0cb0d 100644
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -195,7 +195,6 @@ CJabberProto::~CJabberProto()
int i;
for (i=0; i < m_lstTransports.getCount(); i++)
mir_free(m_lstTransports[i]);
- m_lstTransports.destroy();
for (i=0; i < m_lstJabberFeatCapPairsDynamic.getCount(); i++) {
mir_free(m_lstJabberFeatCapPairsDynamic[i]->szExt);
@@ -203,8 +202,6 @@ CJabberProto::~CJabberProto()
mir_free(m_lstJabberFeatCapPairsDynamic[i]->szDescription);
delete m_lstJabberFeatCapPairsDynamic[i];
}
- m_lstJabberFeatCapPairsDynamic.destroy();
- m_hPrivacyMenuItems.destroy();
}
////////////////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index b81521b2e6..0dfac49aec 100644
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -180,11 +180,9 @@ void ThreadData::xmpp_client_query(void)
port = dnsPort;
break;
} }
- dnsList.destroy();
DnsRecordListFree(results, DnsFreeRecordList);
}
- else
- proto->debugLogA("%s not resolved", temp);
+ else proto->debugLogA("%s not resolved", temp);
}
void CJabberProto::xmlStreamInitialize(char *szWhich)
diff --git a/protocols/JabberG/src/jabber_treelist.cpp b/protocols/JabberG/src/jabber_treelist.cpp
index 60b9e92089..9fc000cf3f 100644
--- a/protocols/JabberG/src/jabber_treelist.cpp
+++ b/protocols/JabberG/src/jabber_treelist.cpp
@@ -49,13 +49,11 @@ struct TTreeList_ItemInfo
flags(0), indent(0), sortIndex(0), iIcon(0), iOverlay(0), data(0) {}
~TTreeList_ItemInfo()
{
- int i;
- for (i = text.getCount(); i--;)
+ for (int i = text.getCount(); i--;)
mir_free(text[i]);
- text.destroy();
- for (i = subItems.getCount(); i--;)
- delete subItems[i];
- subItems.destroy();
+
+ for (int k = subItems.getCount(); k--;)
+ delete subItems[k];
}
};
diff --git a/protocols/JabberG/src/ui_utils.cpp b/protocols/JabberG/src/ui_utils.cpp
index a25002b95b..77cbe4ae78 100644
--- a/protocols/JabberG/src/ui_utils.cpp
+++ b/protocols/JabberG/src/ui_utils.cpp
@@ -39,9 +39,6 @@ CDlgBase::CDlgBase(int idDialog, HWND hwndParent) :
CDlgBase::~CDlgBase()
{
- // remove handlers
- m_controls.destroy();
-
if (m_hwnd)
DestroyWindow(m_hwnd);
}
diff --git a/protocols/MRA/src/Mra.cpp b/protocols/MRA/src/Mra.cpp
index 73328b2a45..fd7c8796d0 100644
--- a/protocols/MRA/src/Mra.cpp
+++ b/protocols/MRA/src/Mra.cpp
@@ -114,6 +114,5 @@ extern "C" __declspec(dllexport) int Unload(void)
g_hDLLXStatusIcons = NULL;
}
- g_Instances.destroy();
return 0;
}
diff --git a/protocols/MSN/src/msn_srv.cpp b/protocols/MSN/src/msn_srv.cpp
index 76c81b1263..c77d2e8997 100644
--- a/protocols/MSN/src/msn_srv.cpp
+++ b/protocols/MSN/src/msn_srv.cpp
@@ -88,12 +88,11 @@ void CMsnProto::MSN_DeleteServerGroup(LPCSTR szId)
void CMsnProto::MSN_FreeGroups(void)
{
- for (int i=0; i < grpList.getCount(); i++)
- {
+ for (int i=0; i < grpList.getCount(); i++) {
ServerGroupItem* p = grpList[i];
mir_free(p->id);
mir_free(p->name);
- mir_free (p);
+ mir_free(p);
}
grpList.destroy();
}
diff --git a/protocols/Omegle/src/main.cpp b/protocols/Omegle/src/main.cpp
index 497717ab98..6d07577936 100644
--- a/protocols/Omegle/src/main.cpp
+++ b/protocols/Omegle/src/main.cpp
@@ -136,7 +136,5 @@ extern "C" int __declspec(dllexport) Unload(void)
for(size_t i=0; i<SIZEOF(g_hEvents); i++)
UnhookEvent(g_hEvents[i]);
- g_Instances.destroy();
-
return 0;
}
diff --git a/protocols/Skype/src/skype_proto.cpp b/protocols/Skype/src/skype_proto.cpp
index 1966d403be..8c9308d78c 100644
--- a/protocols/Skype/src/skype_proto.cpp
+++ b/protocols/Skype/src/skype_proto.cpp
@@ -44,8 +44,6 @@ CSkypeProto::~CSkypeProto()
::mir_free(this->password);
this->password = NULL;
}
-
- this->chatRooms.destroy();
}
HANDLE __cdecl CSkypeProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
diff --git a/protocols/SkypeClassic/src/gchat.cpp b/protocols/SkypeClassic/src/gchat.cpp
index 6964bf8c09..c9f5e5e97f 100644
--- a/protocols/SkypeClassic/src/gchat.cpp
+++ b/protocols/SkypeClassic/src/gchat.cpp
@@ -342,8 +342,8 @@ INT_PTR CALLBACK InputBoxDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
case WM_INITDIALOG:
{
TranslateDialogDefault(hwndDlg);
- SetWindowLong (hwndDlg, DWLP_USER, lParam);
- SetDlgItemText (hwndDlg, IDC_TEXT, (TCHAR*)lParam);
+ SetWindowLongPtr(hwndDlg, DWLP_USER, lParam);
+ SetDlgItemText(hwndDlg, IDC_TEXT, (TCHAR*)lParam);
return TRUE;
}
diff --git a/protocols/Yahoo/src/main.cpp b/protocols/Yahoo/src/main.cpp
index 07e8a80b28..41678a630a 100644
--- a/protocols/Yahoo/src/main.cpp
+++ b/protocols/Yahoo/src/main.cpp
@@ -133,7 +133,6 @@ extern "C" int __declspec(dllexport) Unload(void)
YmsgrLinksUninit();
Netlib_CloseHandle( g_hNetlibUser );
- g_instances.destroy();
return 0;
}
diff --git a/protocols/Yahoo/src/proto.cpp b/protocols/Yahoo/src/proto.cpp
index 93b54514db..183176cb8a 100644
--- a/protocols/Yahoo/src/proto.cpp
+++ b/protocols/Yahoo/src/proto.cpp
@@ -52,12 +52,10 @@ CYahooProto::~CYahooProto()
MenuUninit();
- m_chatrooms.destroy();
-
FREE(m_startMsg);
FREE(m_pw_token);
- Netlib_CloseHandle( m_hNetlibUser );
+ Netlib_CloseHandle(m_hNetlibUser);
}
////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/core/modules.cpp b/src/core/modules.cpp
index e90d18941d..b1d7cbafcb 100644
--- a/src/core/modules.cpp
+++ b/src/core/modules.cpp
@@ -68,7 +68,6 @@ void UnloadButtonModule(void);
void UnloadClcModule(void);
void UnloadContactListModule(void);
void UnloadDatabase(void);
-void UnloadDbintfModule(void);
void UnloadErrorsModule(void);
void UnloadEventsModule(void);
void UnloadExtraIconsModule(void);
@@ -179,6 +178,5 @@ void UnloadDefaultModules(void)
UnloadContactListModule();
UnloadEventsModule();
UnloadNetlibModule();
- UnloadDbintfModule();
UnloadSslModule();
}
diff --git a/src/mir_core/langpack.cpp b/src/mir_core/langpack.cpp
index a23e6311a6..885b6c7f9e 100644
--- a/src/mir_core/langpack.cpp
+++ b/src/mir_core/langpack.cpp
@@ -597,7 +597,6 @@ void UnloadLangPackModule()
int i;
for (i=0; i < lMuuids.getCount(); i++)
mir_free(lMuuids[i]);
- lMuuids.destroy();
LangPackEntry *p = langPack.entry;
for (i=0; i < langPack.entryCount; i++, p++) {
diff --git a/src/mir_core/miranda.cpp b/src/mir_core/miranda.cpp
index 4804665e45..639de6b0c1 100644
--- a/src/mir_core/miranda.cpp
+++ b/src/mir_core/miranda.cpp
@@ -102,7 +102,6 @@ MIR_CORE_DLL(void) UnloadCoreModule(void)
CloseHandle(hThreadQueueEmpty);
TlsFree(mir_tls);
- UninitSubclassing();
UninitProtocols();
DestroyModularEngine();
UninitLogs();
diff --git a/src/mir_core/miranda.h b/src/mir_core/miranda.h
index cc4be6ecae..122d9fe21d 100644
--- a/src/mir_core/miranda.h
+++ b/src/mir_core/miranda.h
@@ -93,8 +93,6 @@ HTREEITEM FindNamedTreeItemAtRoot(HWND hwndTree, const TCHAR *name);
/**** subclass.cpp *********************************************************************/
-void UninitSubclassing();
-
/**** threads.cpp **********************************************************************/
extern DWORD mir_tls;
diff --git a/src/mir_core/modules.cpp b/src/mir_core/modules.cpp
index 0352802dfe..6899a2dbf3 100644
--- a/src/mir_core/modules.cpp
+++ b/src/mir_core/modules.cpp
@@ -652,12 +652,8 @@ int InitialiseModularEngine(void)
void DestroyModularEngine(void)
{
DestroyHooks();
- hooks.destroy();
DeleteCriticalSection(&csHooks);
DestroyServices();
- services.destroy();
DeleteCriticalSection(&csServices);
-
- pluginListAddr.destroy();
}
diff --git a/src/mir_core/subclass.cpp b/src/mir_core/subclass.cpp
index 74d500aee2..ca5dc88d2b 100644
--- a/src/mir_core/subclass.cpp
+++ b/src/mir_core/subclass.cpp
@@ -33,11 +33,6 @@ struct MSubclassData
static LIST<MSubclassData> arSubclass(10, LIST<MSubclassData>::FTSortFunc(HandleKeySortT));
-void UninitSubclassing()
-{
- arSubclass.destroy();
-}
-
/////////////////////////////////////////////////////////////////////////////////////////
static LRESULT CALLBACK MSubclassWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
diff --git a/src/modules/button/button.cpp b/src/modules/button/button.cpp
index 62b5c131cc..437f24f925 100644
--- a/src/modules/button/button.cpp
+++ b/src/modules/button/button.cpp
@@ -613,9 +613,10 @@ int LoadButtonModule(void)
{
if (bModuleInitialized)
return 0;
- bModuleInitialized = TRUE;
- WNDCLASSEX wc = {0};
+ bModuleInitialized = true;
+
+ WNDCLASSEX wc = { 0 };
wc.cbSize = sizeof(wc);
wc.lpszClassName = MIRANDABUTTONCLASS;
wc.lpfnWndProc = MButtonWndProc;
@@ -635,12 +636,8 @@ int LoadButtonModule(void)
void UnloadButtonModule()
{
- if ( !bModuleInitialized)
+ if (!bModuleInitialized)
return;
- {
- mir_cslock lck(csTips);
- lToolTips.destroy();
- }
DeleteCriticalSection(&csTips);
}
diff --git a/src/modules/clist/clistmod.cpp b/src/modules/clist/clistmod.cpp
index a20ee87a0a..547fcc326d 100644
--- a/src/modules/clist/clistmod.cpp
+++ b/src/modules/clist/clistmod.cpp
@@ -541,6 +541,5 @@ void UnloadContactListModule()
}
ImageList_Destroy(hCListImages);
UninitCListEvents();
- protoIconIndex.destroy();
DestroyHookableEvent(hContactDoubleClicked);
}
diff --git a/src/modules/clist/genmenu.cpp b/src/modules/clist/genmenu.cpp
index aa9430712c..07c40e5990 100644
--- a/src/modules/clist/genmenu.cpp
+++ b/src/modules/clist/genmenu.cpp
@@ -186,7 +186,6 @@ int MO_RemoveAllObjects()
{
for (int i=0; i < g_menus.getCount(); i++)
delete g_menus[i];
-
g_menus.destroy();
return 0;
}
@@ -590,7 +589,6 @@ void KillModuleMenus(int hLangpack)
for (int k=0; k < param.arItems.getCount(); k++)
MO_RemoveMenuItem((WPARAM)param.arItems[k], 0);
- param.arItems.destroy();
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/src/modules/clist/movetogroup.cpp b/src/modules/clist/movetogroup.cpp
index b858013c78..b296a1c3a3 100644
--- a/src/modules/clist/movetogroup.cpp
+++ b/src/modules/clist/movetogroup.cpp
@@ -109,8 +109,7 @@ static int OnContactMenuBuild(WPARAM wParam, LPARAM)
pos += 100000; // Separator
- for (i=0; ; i++)
- {
+ for (i=0; ; i++) {
char intname[20];
_itoa(i, intname, 10);
@@ -129,7 +128,6 @@ static int OnContactMenuBuild(WPARAM wParam, LPARAM)
AddGroupItem(hMoveToGroupItem, groups[i].name, ++pos, groups[i].position, checked);
}
- groups.destroy();
return 0;
}
@@ -147,6 +145,5 @@ void MTG_OnmodulesLoad()
int UnloadMoveToGroup(void)
{
- lphGroupsItems.destroy();
return 0;
}
diff --git a/src/modules/crypt/encrypt.cpp b/src/modules/crypt/encrypt.cpp
index ddea529674..d464a3e899 100644
--- a/src/modules/crypt/encrypt.cpp
+++ b/src/modules/crypt/encrypt.cpp
@@ -85,5 +85,4 @@ void UninitCrypt(void)
mir_free(p->pszDescr);
delete p;
}
- arDbPlugins.destroy();
}
diff --git a/src/modules/database/dbintf.cpp b/src/modules/database/dbintf.cpp
index 72afdb4866..35a0557362 100644
--- a/src/modules/database/dbintf.cpp
+++ b/src/modules/database/dbintf.cpp
@@ -166,8 +166,3 @@ int LoadDbintfModule()
CreateServiceFunction(MS_DB_DESTROY_INSTANCE, srvDestroyInstance);
return 0;
}
-
-void UnloadDbintfModule()
-{
- arDbPlugins.destroy();
-}
diff --git a/src/modules/database/dbutils.cpp b/src/modules/database/dbutils.cpp
index 302d7fdd65..f57ce37446 100644
--- a/src/modules/database/dbutils.cpp
+++ b/src/modules/database/dbutils.cpp
@@ -274,7 +274,6 @@ static INT_PTR DbDeleteModule(WPARAM, LPARAM lParam)
db_unset(NULL, (char*)lParam, vars[i]);
mir_free(vars[i]);
}
- vars.destroy();
return 0;
}
@@ -366,6 +365,4 @@ void UnloadEventsModule()
mir_free(p->iconService);
mir_free(p);
}
-
- eventTypes.destroy();
}
diff --git a/src/modules/database/mdatabasecache.cpp b/src/modules/database/mdatabasecache.cpp
index 6a8a58c1f4..f6c13e0cda 100644
--- a/src/modules/database/mdatabasecache.cpp
+++ b/src/modules/database/mdatabasecache.cpp
@@ -45,9 +45,6 @@ MDatabaseCache::MDatabaseCache() :
MDatabaseCache::~MDatabaseCache()
{
- m_lContacts.destroy();
- m_lSettings.destroy();
- m_lGlobalSettings.destroy();
HeapDestroy(m_hCacheHeap);
DeleteCriticalSection(&m_cs);
}
diff --git a/src/modules/extraicons/ExtraIconGroup.cpp b/src/modules/extraicons/ExtraIconGroup.cpp
index e2127ebb87..5ec33e2b2c 100644
--- a/src/modules/extraicons/ExtraIconGroup.cpp
+++ b/src/modules/extraicons/ExtraIconGroup.cpp
@@ -32,7 +32,6 @@ ExtraIconGroup::ExtraIconGroup(const char *_name) :
ExtraIconGroup::~ExtraIconGroup()
{
- items.destroy();
}
void ExtraIconGroup::addExtraIcon(BaseExtraIcon *extra)
diff --git a/src/modules/extraicons/extraicons.cpp b/src/modules/extraicons/extraicons.cpp
index c96dd3629f..99abd93ed0 100644
--- a/src/modules/extraicons/extraicons.cpp
+++ b/src/modules/extraicons/extraicons.cpp
@@ -227,11 +227,9 @@ void KillModuleExtraIcons(int hLangpack)
LIST<ExtraIconGroup> groups(1);
LoadGroups(groups);
RebuildListsBasedOnGroups(groups);
- groups.destroy();
for (int k=0; k < arDeleted.getCount(); k++)
delete arDeleted[k];
- arDeleted.destroy();
}
///////////////////////////////////////////////////////////////////////////////
@@ -457,7 +455,6 @@ INT_PTR ExtraIcon_Register(WPARAM wParam, LPARAM lParam)
}
}
- groups.destroy();
return id;
}
@@ -541,8 +538,4 @@ void UnloadExtraIconsModule(void)
{
for (int i=0; i < registeredExtraIcons.getCount(); i++)
delete registeredExtraIcons[i];
-
- registeredExtraIcons.destroy();
- extraIconsByHandle.destroy();
- extraIconsBySlot.destroy();
}
diff --git a/src/modules/extraicons/options_ei.cpp b/src/modules/extraicons/options_ei.cpp
index 0edbec8050..8432b945a9 100644
--- a/src/modules/extraicons/options_ei.cpp
+++ b/src/modules/extraicons/options_ei.cpp
@@ -220,7 +220,6 @@ LRESULT CALLBACK TreeProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
TreeView_SelectItem(hwndDlg, hti.hItem);
Tree_Select(hwndDlg, selected);
- selected.destroy();
}
else if (wParam & MK_SHIFT) {
HTREEITEM hItem = TreeView_GetSelection(hwndDlg);
@@ -233,7 +232,6 @@ LRESULT CALLBACK TreeProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
TreeView_SelectItem(hwndDlg, hti.hItem);
Tree_Select(hwndDlg, selected);
Tree_SelectRange(hwndDlg, hItem, hti.hItem);
- selected.destroy();
}
return 0;
@@ -342,8 +340,6 @@ static void GroupSelectedItems(HWND tree)
UnselectAll(tree);
TreeView_SelectItem(tree, hNew);
}
-
- toRemove.destroy();
}
static void UngroupSelectedItems(HWND tree)
@@ -587,7 +583,6 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
}
delete[] oldSlots;
- groups.destroy();
return TRUE;
}
diff --git a/src/modules/icolib/skin2icons.cpp b/src/modules/icolib/skin2icons.cpp
index 585e26ab60..e5a21e7a56 100644
--- a/src/modules/icolib/skin2icons.cpp
+++ b/src/modules/icolib/skin2icons.cpp
@@ -881,7 +881,6 @@ void UnloadIcoLibModule(void)
IcoLib_FreeIcon(p);
mir_free(p);
}
- iconList.destroy();
for (i = iconSourceList.getCount()-1; i >= 0; i--) {
IconSourceItem* p = iconSourceList[i];
@@ -891,7 +890,6 @@ void UnloadIcoLibModule(void)
SAFE_FREE((void**)&p->icon_data);
SAFE_FREE((void**)&p);
}
- iconSourceList.destroy();
for (i = iconSourceFileList.getCount()-1; i >= 0; i--) {
IconSourceFile* p = iconSourceFileList[i];
@@ -899,13 +897,11 @@ void UnloadIcoLibModule(void)
SAFE_FREE((void**)&p->file);
SAFE_FREE((void**)&p);
}
- iconSourceFileList.destroy();
for (i = 0; i < sectionList.getCount(); i++) {
SAFE_FREE((void**)&sectionList[i]->name);
mir_free(sectionList[i]);
}
- sectionList.destroy();
SafeDestroyIcon(&hIconBlank);
bModuleInitialized = false;
diff --git a/src/modules/netlib/netlib.cpp b/src/modules/netlib/netlib.cpp
index c42b43a89f..dff3084348 100644
--- a/src/modules/netlib/netlib.cpp
+++ b/src/modules/netlib/netlib.cpp
@@ -423,10 +423,9 @@ void UnloadNetlibModule(void)
for (int i = netlibUser.getCount(); i > 0; i--)
NetlibCloseHandle((WPARAM)netlibUser[i-1], 0);
- netlibUser.destroy();
-
CloseHandle(hConnectionHeaderMutex);
- if (hConnectionOpenMutex) CloseHandle(hConnectionOpenMutex);
+ if (hConnectionOpenMutex)
+ CloseHandle(hConnectionOpenMutex);
DeleteCriticalSection(&csNetlibUser);
WSACleanup();
}
diff --git a/src/modules/netlib/netlibautoproxy.cpp b/src/modules/netlib/netlibautoproxy.cpp
index f0cf323776..44cfde41cd 100644
--- a/src/modules/netlib/netlibautoproxy.cpp
+++ b/src/modules/netlib/netlibautoproxy.cpp
@@ -447,7 +447,6 @@ void NetlibUnloadIeProxy(void)
for (i=0; i < proxyBypass.getCount(); i++)
mir_free(proxyBypass[i]);
- proxyBypass.destroy();
mir_free(abuf.lpszScriptBuffer);
CloseHandle(hIeProxyMutex);
diff --git a/src/modules/options/filter.h b/src/modules/options/filter.h
index afe04fc50b..0f51c84653 100644
--- a/src/modules/options/filter.h
+++ b/src/modules/options/filter.h
@@ -52,11 +52,7 @@ public:
~CPageKeywords()
{
for (int j = 0; j < _pageKeyWords.getCount(); j++)
- {
- TCHAR *data = _pageKeyWords[j];
- mir_free(data);
- }
- _pageKeyWords.destroy();
+ mir_free(_pageKeyWords[j]);
};
void AddKeyWord(TCHAR *ptKeyWord)
diff --git a/src/modules/plugins/newplugins.cpp b/src/modules/plugins/newplugins.cpp
index f61710c09b..07a29d6db4 100644
--- a/src/modules/plugins/newplugins.cpp
+++ b/src/modules/plugins/newplugins.cpp
@@ -866,8 +866,4 @@ void UnloadNewPluginsModule(void)
if (hPluginListHeap) HeapDestroy(hPluginListHeap);
hPluginListHeap = 0;
-
- pluginList.destroy();
- servicePlugins.destroy();
- clistPlugins.destroy();
}
diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp
index aed4ae4c62..06c469845a 100644
--- a/src/modules/protocols/protoaccs.cpp
+++ b/src/modules/protocols/protoaccs.cpp
@@ -597,17 +597,13 @@ void UnloadAccount(PROTOACCOUNT* pa, bool bIsDynamic, bool bErase)
void UnloadAccountsModule()
{
- int i;
-
if ( !bModuleInitialized) return;
- for (i = accounts.getCount()-1; i >= 0; i--) {
+ for (int i = accounts.getCount()-1; i >= 0; i--) {
PROTOACCOUNT* pa = accounts[ i ];
UnloadAccount(pa, false, false);
accounts.remove(i);
}
-
- accounts.destroy();
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/modules/protocols/protocols.cpp b/src/modules/protocols/protocols.cpp
index 3de239ebbb..d7d34a2275 100644
--- a/src/modules/protocols/protocols.cpp
+++ b/src/modules/protocols/protocols.cpp
@@ -733,14 +733,10 @@ void UnloadProtocolsModule()
mir_free(protos[i]->szName);
mir_free(protos[i]);
}
- protos.destroy();
}
for (int i=0; i < serviceItems.getCount(); i++)
mir_free(serviceItems[i]);
- serviceItems.destroy();
-
- filters.destroy();
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/modules/skin/hotkeys.cpp b/src/modules/skin/hotkeys.cpp
index ea50fdb760..95928b7aa3 100644
--- a/src/modules/skin/hotkeys.cpp
+++ b/src/modules/skin/hotkeys.cpp
@@ -399,7 +399,6 @@ void UnloadSkinHotkeys(void)
for (int i=0; i < hotkeys.getCount(); i++)
FreeHotkey(hotkeys[i]);
- hotkeys.destroy();
DestroyWindow(g_hwndHotkeyHost);
}
diff --git a/src/modules/skin/sounds.cpp b/src/modules/skin/sounds.cpp
index 1641e595aa..e6aa790610 100644
--- a/src/modules/skin/sounds.cpp
+++ b/src/modules/skin/sounds.cpp
@@ -468,6 +468,4 @@ void UnloadSkinSounds(void)
{
for (int i=0; i < arSounds.getCount(); i++)
arSounds[i].clear();
-
- arSounds.destroy();
}
diff --git a/src/modules/srmm/statusicon.cpp b/src/modules/srmm/statusicon.cpp
index 2b88911990..ea6f8b9d76 100644
--- a/src/modules/srmm/statusicon.cpp
+++ b/src/modules/srmm/statusicon.cpp
@@ -216,7 +216,6 @@ int LoadSrmmModule()
void UnloadSrmmModule()
{
- arIcons.destroy();
NotifyEventHooks(hHookIconsChanged, NULL, NULL);
DestroyHookableEvent(hHookIconsChanged);
}
diff --git a/src/modules/utils/timezones.cpp b/src/modules/utils/timezones.cpp
index 6183dc151e..9cbd78c8fb 100644
--- a/src/modules/utils/timezones.cpp
+++ b/src/modules/utils/timezones.cpp
@@ -592,9 +592,3 @@ void InitTimeZones(void)
tmi.cbSize = sizeof(tmi);
GetTimeApi(0, (LPARAM)&tmi);
}
-
-void UninitTimeZones(void)
-{
- g_timezonesBias.destroy();
- g_timezones.destroy();
-}
diff --git a/src/modules/utils/utils.cpp b/src/modules/utils/utils.cpp
index 33c95995bd..823b981721 100644
--- a/src/modules/utils/utils.cpp
+++ b/src/modules/utils/utils.cpp
@@ -39,7 +39,6 @@ int InitBitmapFilter(void);
void InitXmlApi(void);
void InitTimeZones(void);
-void UninitTimeZones(void);
int InitCrypt(void);
void UninitCrypt(void);
@@ -492,5 +491,4 @@ void UnloadUtilsModule(void)
UninitCrypt();
FreeWindowList();
- UninitTimeZones();
}