summaryrefslogtreecommitdiff
path: root/protocols
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 /protocols
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
Diffstat (limited to 'protocols')
-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
28 files changed, 11 insertions, 64 deletions
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);
}
////////////////////////////////////////////////////////////////////////////////////////