diff options
author | George Hazan <george.hazan@gmail.com> | 2014-01-02 20:20:47 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-01-02 20:20:47 +0000 |
commit | 8712f0c3591941711f8407fc069a1fbd98efbd65 (patch) | |
tree | c75825bc3d05f543e622770c684e09113ddbeb79 /plugins | |
parent | ad5dee8e7d01ea0cd2b96a7f46e1f6fc9692825a (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
Diffstat (limited to 'plugins')
27 files changed, 2 insertions, 52 deletions
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();
}
|