History

set pointers to null and call uninit

sijchen committed 10 years ago

Commit 74955c81 parent cc675f92 files · +18 −0Browse files

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

Unified · Split

codec/common/src/WelsThreadPool.cpp+17−0
@@ -52,16 +52,28 @@ CWelsThreadPool::CWelsThreadPool (IWelsThreadPoolSink* pSink, int32_t iMaxThread · 51 unmodified lines
5252
5353 if (NULL == m_cWaitedTasks || NULL == m_cIdleThreads || NULL == m_cBusyThreads) {
5454 delete m_cWaitedTasks;
55+ m_cWaitedTasks = NULL;
56+
5557 delete m_cIdleThreads;
58+ m_cIdleThreads = NULL;
59+
5660 delete m_cBusyThreads;
61+ m_cBusyThreads = NULL;
62+
5763 return;
5864 }
5965
6066 if (WELS_THREAD_ERROR_OK != Init (iMaxThreadNum)) {
6167 Uninit();
68+
6269 delete m_cWaitedTasks;
70+ m_cWaitedTasks = NULL;
71+
6372 delete m_cIdleThreads;
73+ m_cIdleThreads = NULL;
74+
6475 delete m_cBusyThreads;
76+ m_cBusyThreads = NULL;
6577 }
6678 }
6779
@@ -70,8 +82,13 @@ CWelsThreadPool::~CWelsThreadPool() { · 2 unmodified lines
7082 Uninit();
7183
7284 delete m_cWaitedTasks;
85+ m_cWaitedTasks = NULL;
86+
7387 delete m_cIdleThreads;
88+ m_cIdleThreads = NULL;
89+
7490 delete m_cBusyThreads;
91+ m_cBusyThreads = NULL;
7592 }
7693
7794 WELS_THREAD_ERROR_CODE CWelsThreadPool::OnTaskStart (CWelsTaskThread* pThread, IWelsTask* pTask) {

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