diff options
author | George Hazan <george.hazan@gmail.com> | 2014-12-14 14:33:17 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-12-14 14:33:17 +0000 |
commit | 56ecec5734194ccf709c3f57fe1a15a1b926c68d (patch) | |
tree | ce049dc932a37e32a1e8810a70562d2b0a32d9df /protocols/MRA/src/MraMPop.cpp | |
parent | ffe922189b20daaf132ddfc24bfea9bf03a3a94b (diff) |
let's operator new() clean the memory
git-svn-id: http://svn.miranda-ng.org/main/trunk@11406 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MRA/src/MraMPop.cpp')
-rw-r--r-- | protocols/MRA/src/MraMPop.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/protocols/MRA/src/MraMPop.cpp b/protocols/MRA/src/MraMPop.cpp index 9796744f29..55f485eae7 100644 --- a/protocols/MRA/src/MraMPop.cpp +++ b/protocols/MRA/src/MraMPop.cpp @@ -11,8 +11,8 @@ struct MRA_MPOP_SESSION_QUEUE : public FIFO_MT struct MRA_MPOP_SESSION_QUEUE_ITEM : public FIFO_MT_ITEM
{
- LPSTR lpszUrl; /* Url to open. */
- size_t dwUrlSize;
+ LPSTR lpszUrl; /* Url to open. */
+ size_t dwUrlSize;
};
void MraMPopSessionQueueClear(HANDLE hMPopSessionQueue);
@@ -24,14 +24,10 @@ DWORD MraMPopSessionQueueInitialize(HANDLE *phMPopSessionQueue) if ((*phMPopSessionQueue))
return ERROR_ALREADY_INITIALIZED;
- MRA_MPOP_SESSION_QUEUE *pmpsqMPopSessionQueue = (MRA_MPOP_SESSION_QUEUE*)mir_calloc(sizeof(MRA_MPOP_SESSION_QUEUE));
+ MRA_MPOP_SESSION_QUEUE *pmpsqMPopSessionQueue = new MRA_MPOP_SESSION_QUEUE();
if (!pmpsqMPopSessionQueue)
return GetLastError();
- pmpsqMPopSessionQueue->bKeyValid = false;
- pmpsqMPopSessionQueue->lpszMPOPKey = NULL;
- pmpsqMPopSessionQueue->dwMPOPKeySize = 0;
- ListMTInitialize(pmpsqMPopSessionQueue);
*phMPopSessionQueue = (HANDLE)pmpsqMPopSessionQueue;
return NO_ERROR;
}
@@ -59,8 +55,7 @@ void MraMPopSessionQueueDestroy(HANDLE hMPopSessionQueue) MRA_MPOP_SESSION_QUEUE *pmpsqMPopSessionQueue = (MRA_MPOP_SESSION_QUEUE*)hMPopSessionQueue;
MraMPopSessionQueueClear(hMPopSessionQueue);
- ListMTDestroy(pmpsqMPopSessionQueue);
- mir_free(pmpsqMPopSessionQueue);
+ delete pmpsqMPopSessionQueue;
}
DWORD CMraProto::MraMPopSessionQueueAddUrl(HANDLE hMPopSessionQueue, const CMStringA &lpszUrl)
@@ -149,7 +144,7 @@ void CMraProto::MraMPopSessionQueueFlush(HANDLE hMPopSessionQueue) MRA_MPOP_SESSION_QUEUE *pmpsqMPopSessionQueue = (MRA_MPOP_SESSION_QUEUE*)hMPopSessionQueue;
MRA_MPOP_SESSION_QUEUE_ITEM *pmpsqi;
- while ( FifoMTItemPop(pmpsqMPopSessionQueue, NULL, (LPVOID*)&pmpsqi) == NO_ERROR) {
+ while (FifoMTItemPop(pmpsqMPopSessionQueue, NULL, (LPVOID*)&pmpsqi) == NO_ERROR) {
CallService(MS_UTILS_OPENURL, OUF_NEWWINDOW, (LPARAM)pmpsqi->lpszUrl);
mir_free(pmpsqi);
}
@@ -170,7 +165,7 @@ DWORD MraMPopSessionQueueSetNewMPopKey(HANDLE hMPopSessionQueue, const CMStringA pmpsqMPopSessionQueue->bKeyValid = true;
pmpsqMPopSessionQueue->dwMPOPKeySize = szKey.GetLength();
memcpy(pmpsqMPopSessionQueue->lpszMPOPKey, szKey, szKey.GetLength());
- (*(pmpsqMPopSessionQueue->lpszMPOPKey + szKey.GetLength())) = 0;
+ *(pmpsqMPopSessionQueue->lpszMPOPKey + szKey.GetLength()) = 0;
return NO_ERROR;
}
|