ACE_WIN32_Proactor与ACE_Proactor清理时问题.
ACE_WIN32_Proactor* pWin32Proactor = new ACE_WIN32_Proactor(m_nThreadCount);if(NULL == pWin32Proactor)
{
m_u4ProactorID = PIG_PROACTOR_CLIENTDEFINE;
m_nThreadCount = 1;
return false;
}
m_pProactor = new ACE_Proactor(pWin32Proactor, 1);
if(NULL == m_pProactor)
{
return false;
}
大家看下这段代码,在删除m_pProactor框架时,ACE_WIN32_Proactor* pWin32Proactor框架会不会删除?
还是需要用户自己进行清理.
我的理解是pWin32Proactor装入到pProactor 中,删除由pProactor 管理了.不知道这样的想法是否是对的?
看一下ACE_Proactor的析构处理。我记不清了。 他有个参数标明是由他删除还是你自己处理。
ACE_Proactor (ACE_Proactor_Impl *implementation=0, int delete_implementation=0, TIMER_QUEUE *tq=0)
就是你写的代码里的:
m_pProactor = new ACE_Proactor(pWin32Proactor, 1);---->这里的1标明的。
Constructor. If <implementation> is 0, the correct implementation object will be created. <delete_implementation> flag determines whether the implementation object should be deleted by the Proactor or not. If <tq> is 0, a new TIMER_QUEUE is created. sevencat 发表于 2012-6-29 06:45 static/image/common/back.gif
他有个参数标明是由他删除还是你自己处理。
ACE_Proactor (ACE_Proactor_Impl *implementation=0, int dele ...
嗯,这下明白了.
页:
[1]