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/MraFilesQueue.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/MraFilesQueue.cpp')
-rw-r--r-- | protocols/MRA/src/MraFilesQueue.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/protocols/MRA/src/MraFilesQueue.cpp b/protocols/MRA/src/MraFilesQueue.cpp index f795753d96..6d0a7642b5 100644 --- a/protocols/MRA/src/MraFilesQueue.cpp +++ b/protocols/MRA/src/MraFilesQueue.cpp @@ -7,7 +7,7 @@ struct MRA_FILES_QUEUE : public LIST_MT
{
- DWORD dwSendTimeOutInterval;
+ DWORD dwSendTimeOutInterval;
};
struct MRA_FILES_QUEUE_FILE
@@ -141,18 +141,13 @@ DWORD MraFilesQueueInitialize(DWORD dwSendTimeOutInterval, HANDLE *phFilesQueueH if (!phFilesQueueHandle)
return ERROR_INVALID_HANDLE;
- MRA_FILES_QUEUE *pmrafqFilesQueue = (MRA_FILES_QUEUE*)mir_calloc(sizeof(MRA_FILES_QUEUE));
+ MRA_FILES_QUEUE *pmrafqFilesQueue = new MRA_FILES_QUEUE();
if (!pmrafqFilesQueue)
return GetLastError();
- DWORD dwRetErrorCode = ListMTInitialize(pmrafqFilesQueue);
- if (dwRetErrorCode == NO_ERROR) {
- pmrafqFilesQueue->dwSendTimeOutInterval = dwSendTimeOutInterval;
- *phFilesQueueHandle = (HANDLE)pmrafqFilesQueue;
- }
- else mir_free(pmrafqFilesQueue);
-
- return dwRetErrorCode;
+ pmrafqFilesQueue->dwSendTimeOutInterval = dwSendTimeOutInterval;
+ *phFilesQueueHandle = (HANDLE)pmrafqFilesQueue;
+ return NO_ERROR;
}
void MraFilesQueueDestroy(HANDLE hFilesQueueHandle)
@@ -167,8 +162,7 @@ void MraFilesQueueDestroy(HANDLE hFilesQueueHandle) while (ListMTItemGetFirst(pmrafqFilesQueue, NULL, (LPVOID*)&dat) == NO_ERROR)
MraFilesQueueItemFree(dat);
}
- ListMTDestroy(pmrafqFilesQueue);
- mir_free(pmrafqFilesQueue);
+ delete pmrafqFilesQueue;
}
DWORD MraFilesQueueItemFindByID(HANDLE hFilesQueueHandle, DWORD dwIDRequest, MRA_FILES_QUEUE_ITEM **ppmrafqFilesQueueItem)
|