set pointers to null and call uninit
This commit is contained in:
parent
cc675f9fd1
commit
74955c877f
@ -52,16 +52,28 @@ CWelsThreadPool::CWelsThreadPool (IWelsThreadPoolSink* pSink, int32_t iMaxThread
|
||||
|
||||
if (NULL == m_cWaitedTasks || NULL == m_cIdleThreads || NULL == m_cBusyThreads) {
|
||||
delete m_cWaitedTasks;
|
||||
m_cWaitedTasks = NULL;
|
||||
|
||||
delete m_cIdleThreads;
|
||||
m_cIdleThreads = NULL;
|
||||
|
||||
delete m_cBusyThreads;
|
||||
m_cBusyThreads = NULL;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (WELS_THREAD_ERROR_OK != Init (iMaxThreadNum)) {
|
||||
Uninit();
|
||||
|
||||
delete m_cWaitedTasks;
|
||||
m_cWaitedTasks = NULL;
|
||||
|
||||
delete m_cIdleThreads;
|
||||
m_cIdleThreads = NULL;
|
||||
|
||||
delete m_cBusyThreads;
|
||||
m_cBusyThreads = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@ -70,8 +82,13 @@ CWelsThreadPool::~CWelsThreadPool() {
|
||||
Uninit();
|
||||
|
||||
delete m_cWaitedTasks;
|
||||
m_cWaitedTasks = NULL;
|
||||
|
||||
delete m_cIdleThreads;
|
||||
m_cIdleThreads = NULL;
|
||||
|
||||
delete m_cBusyThreads;
|
||||
m_cBusyThreads = NULL;
|
||||
}
|
||||
|
||||
WELS_THREAD_ERROR_CODE CWelsThreadPool::OnTaskStart (CWelsTaskThread* pThread, IWelsTask* pTask) {
|
||||
|
@ -66,6 +66,7 @@ IWelsTaskManage* IWelsTaskManage::CreateTaskManage (sWelsEncCtx* pCtx, const i
|
||||
WELS_VERIFY_RETURN_IF (NULL, NULL == pTaskManage)
|
||||
|
||||
if ( ENC_RETURN_SUCCESS != pTaskManage->Init (pCtx) ) {
|
||||
pTaskManage->Uninit();
|
||||
delete pTaskManage;
|
||||
pTaskManage = NULL;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user