History

use WELS_DELETE_OP for deleting

sijchen committed 10 years ago

Commit e07ee9c1 parent 74955c84 files · +17 −35Browse files

Showing the changes to codec/common/src/WelsThreadPool.cpp (1 of 4 files). Show all

Unified · Split

codec/common/src/WelsThreadPool.cpp+11−25
@@ -38,6 +38,7 @@ · 37 unmodified lines
3838 *************************************************************************************
3939 */
4040 #include "typedefs.h"
41+#include "memory_align.h"
4142 #include "WelsThreadPool.h"
4243
4344 namespace WelsCommon {
@@ -51,14 +52,9 @@ CWelsThreadPool::CWelsThreadPool (IWelsThreadPoolSink* pSink, int32_t iMaxThread · 7 unmodified lines
5152 m_iMaxThreadNum = 0;
5253
5354 if (NULL == m_cWaitedTasks || NULL == m_cIdleThreads || NULL == m_cBusyThreads) {
54− delete m_cWaitedTasks;
55− m_cWaitedTasks = NULL;
56−
57− delete m_cIdleThreads;
58− m_cIdleThreads = NULL;
59−
60− delete m_cBusyThreads;
61− m_cBusyThreads = NULL;
55+ WELS_DELETE_OP(m_cWaitedTasks);
56+ WELS_DELETE_OP(m_cIdleThreads);
57+ WELS_DELETE_OP(m_cBusyThreads);
6258
6359 return;
6460 }
@@ -66,14 +62,9 @@ CWelsThreadPool::CWelsThreadPool (IWelsThreadPoolSink* pSink, int32_t iMaxThread · 1 unmodified line
6662 if (WELS_THREAD_ERROR_OK != Init (iMaxThreadNum)) {
6763 Uninit();
6864
69− delete m_cWaitedTasks;
70− m_cWaitedTasks = NULL;
71−
72− delete m_cIdleThreads;
73− m_cIdleThreads = NULL;
74−
75− delete m_cBusyThreads;
76− m_cBusyThreads = NULL;
65+ WELS_DELETE_OP(m_cWaitedTasks);
66+ WELS_DELETE_OP(m_cIdleThreads);
67+ WELS_DELETE_OP(m_cBusyThreads);
7768 }
7869 }
7970
@@ -81,14 +72,9 @@ CWelsThreadPool::CWelsThreadPool (IWelsThreadPoolSink* pSink, int32_t iMaxThread · 1 unmodified line
8172 CWelsThreadPool::~CWelsThreadPool() {
8273 Uninit();
8374
84− delete m_cWaitedTasks;
85− m_cWaitedTasks = NULL;
86−
87− delete m_cIdleThreads;
88− m_cIdleThreads = NULL;
89−
90− delete m_cBusyThreads;
91− m_cBusyThreads = NULL;
75+ WELS_DELETE_OP(m_cWaitedTasks);
76+ WELS_DELETE_OP(m_cIdleThreads);
77+ WELS_DELETE_OP(m_cBusyThreads);
9278 }
9379
9480 WELS_THREAD_ERROR_CODE CWelsThreadPool::OnTaskStart (CWelsTaskThread* pThread, IWelsTask* pTask) {
@@ -214,7 +200,7 @@ WELS_THREAD_ERROR_CODE CWelsThreadPool::CreateIdleThread() { · 119 unmodified lines
214200
215201 void CWelsThreadPool::DestroyThread (CWelsTaskThread* pThread) {
216202 pThread->Kill();
217− delete pThread;
203+ WELS_DELETE_OP(pThread);
218204
219205 return;
220206 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t