用CWinThread创建的用户线程保存了其指针,线程关闭后该指针要用delete 释放吗:
m_pDrawPngThread=AfxBeginThread(RUNTIME_CLASS(CMyThread));

解决方案 »

  1.   

    用CloseHandle(m_pDrawPngThread)关闭就可以了
      

  2.   

    要是不使用Handle可以创建线程后即刻CloseHandle,这样就不用关他了
      

  3.   

    You should set CWinThread::m_bAutoDelete to FALSE and delete it by yourself
    reference
    http://msdn2.microsoft.com/en-us/library/efk30beh.aspx
      

  4.   

    default true. This means the thread will be deleted automatically upon completion
    However, often you need to clean up the resources used by other threads before the message pump stops. A common practice is to delete all thread before the main window is destroyed.