Showing the changes to codec/common/src/WelsThreadPool.cpp (1 of 4 files). Show all
Unified · Split
| @@ -38,6 +38,7 @@ · 37 unmodified lines | |||
| 38 | ************************************************************************************* | 38 | ************************************************************************************* |
| 39 | */ | 39 | */ |
| 40 | #include "typedefs.h" | 40 | #include "typedefs.h" |
| 41 | #include "memory_align.h" | ||
| 41 | #include "WelsThreadPool.h" | 42 | #include "WelsThreadPool.h" |
| 42 | 43 | ||
| 43 | namespace WelsCommon { | 44 | namespace WelsCommon { |
| @@ -51,14 +52,9 @@ CWelsThreadPool::CWelsThreadPool (IWelsThreadPoolSink* pSink, int32_t iMaxThread · 7 unmodified lines | |||
| 51 | m_iMaxThreadNum = 0; | 52 | m_iMaxThreadNum = 0; |
| 52 | 53 | ||
| 53 | if (NULL == m_cWaitedTasks || NULL == m_cIdleThreads || NULL == m_cBusyThreads) { | 54 | if (NULL == m_cWaitedTasks || NULL == m_cIdleThreads || NULL == m_cBusyThreads) { |
| 54 | delete m_cWaitedTasks; | 55 | WELS_DELETE_OP(m_cWaitedTasks); |
| 55 | m_cWaitedTasks = NULL; | 56 | WELS_DELETE_OP(m_cIdleThreads); |
| 56 | 57 | WELS_DELETE_OP(m_cBusyThreads); | |
| 57 | delete m_cIdleThreads; | ||
| 58 | m_cIdleThreads = NULL; | ||
| 59 | |||
| 60 | delete m_cBusyThreads; | ||
| 61 | m_cBusyThreads = NULL; | ||
| 62 | 58 | ||
| 63 | return; | 59 | return; |
| 64 | } | 60 | } |
| @@ -66,14 +62,9 @@ CWelsThreadPool::CWelsThreadPool (IWelsThreadPoolSink* pSink, int32_t iMaxThread · 1 unmodified line | |||
| 66 | if (WELS_THREAD_ERROR_OK != Init (iMaxThreadNum)) { | 62 | if (WELS_THREAD_ERROR_OK != Init (iMaxThreadNum)) { |
| 67 | Uninit(); | 63 | Uninit(); |
| 68 | 64 | ||
| 69 | delete m_cWaitedTasks; | 65 | WELS_DELETE_OP(m_cWaitedTasks); |
| 70 | m_cWaitedTasks = NULL; | 66 | WELS_DELETE_OP(m_cIdleThreads); |
| 71 | 67 | WELS_DELETE_OP(m_cBusyThreads); | |
| 72 | delete m_cIdleThreads; | ||
| 73 | m_cIdleThreads = NULL; | ||
| 74 | |||
| 75 | delete m_cBusyThreads; | ||
| 76 | m_cBusyThreads = NULL; | ||
| 77 | } | 68 | } |
| 78 | } | 69 | } |
| 79 | 70 | ||
| @@ -81,14 +72,9 @@ CWelsThreadPool::CWelsThreadPool (IWelsThreadPoolSink* pSink, int32_t iMaxThread · 1 unmodified line | |||
| 81 | CWelsThreadPool::~CWelsThreadPool() { | 72 | CWelsThreadPool::~CWelsThreadPool() { |
| 82 | Uninit(); | 73 | Uninit(); |
| 83 | 74 | ||
| 84 | delete m_cWaitedTasks; | 75 | WELS_DELETE_OP(m_cWaitedTasks); |
| 85 | m_cWaitedTasks = NULL; | 76 | WELS_DELETE_OP(m_cIdleThreads); |
| 86 | 77 | WELS_DELETE_OP(m_cBusyThreads); | |
| 87 | delete m_cIdleThreads; | ||
| 88 | m_cIdleThreads = NULL; | ||
| 89 | |||
| 90 | delete m_cBusyThreads; | ||
| 91 | m_cBusyThreads = NULL; | ||
| 92 | } | 78 | } |
| 93 | 79 | ||
| 94 | WELS_THREAD_ERROR_CODE CWelsThreadPool::OnTaskStart (CWelsTaskThread* pThread, IWelsTask* pTask) { | 80 | WELS_THREAD_ERROR_CODE CWelsThreadPool::OnTaskStart (CWelsTaskThread* pThread, IWelsTask* pTask) { |
| @@ -214,7 +200,7 @@ WELS_THREAD_ERROR_CODE CWelsThreadPool::CreateIdleThread() { · 119 unmodified lines | |||
| 214 | 200 | ||
| 215 | void CWelsThreadPool::DestroyThread (CWelsTaskThread* pThread) { | 201 | void CWelsThreadPool::DestroyThread (CWelsTaskThread* pThread) { |
| 216 | pThread->Kill(); | 202 | pThread->Kill(); |
| 217 | delete pThread; | 203 | WELS_DELETE_OP(pThread); |
| 218 | 204 | ||
| 219 | return; | 205 | return; |
| 220 | } | 206 | } |