at the end 
delete port;

解决方案 »

  1.   

    这个线程回调函数没有memory leak.只是你启动的这个线程本身无法结束(return 条件不满足),
    should do this:
    startup :CWinThread* pTheThread = AfxBeginThread(...);destory:
    if (pTheThread) delete pTheThread;
      

  2.   

    你调用AfxBeginThread()创建的thread没有被释放掉,thrdcore.cpp中166行是:
    CWinThread* pThread = DEBUG_NEW CWinThread(pfnThreadProc, pParam);
      

  3.   

    建议在程序中加入
    _CrtSetBreakAlloc(86);
    来看一下到底是在哪分配的内存
      

  4.   

    seesi是对的。 
    TCommPort *port =(TCommPort *) arglist;
    这个可能是函数外new的。 却没删。可是。呵呵 也不该你删呀^_^
      

  5.   

    delete port出错
    我是这样创建的
    if (!AfxBeginThread(TCommPort::WatchCommThread,port))
    return;
      

  6.   

    I'm Sorry to all,I began two Threads,but only end one !   ~_~
      

  7.   

    bounds checker工具,如果有正版的最好了。