delete this 问题
行路人 2011-11-15 02:27:51 为什么delete this以后还可以访问this指针?应该是不可以访问的呀!附上几行代码:
void CWinThread::Delete()
{
if (m_bAutoDelete)
delete this;
}
CWinThread::~CWinThread()
{
if (m_hThread != NULL)
CloseHandle(m_hThread);
AFX_MODULE_THREAD_STATE* pState = AfxGetModuleThreadState();
if (pState->m_pCurrentWinThread == this)
pState->m_pCurrentWinThread = NULL;
}