*****************内存泄露,高手请进******************(在线给分) at the end delete port; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这个线程回调函数没有memory leak.只是你启动的这个线程本身无法结束(return 条件不满足),should do this:startup :CWinThread* pTheThread = AfxBeginThread(...);destory:if (pTheThread) delete pTheThread; 你调用AfxBeginThread()创建的thread没有被释放掉,thrdcore.cpp中166行是:CWinThread* pThread = DEBUG_NEW CWinThread(pfnThreadProc, pParam); 建议在程序中加入 _CrtSetBreakAlloc(86);来看一下到底是在哪分配的内存 seesi是对的。 TCommPort *port =(TCommPort *) arglist;这个可能是函数外new的。 却没删。可是。呵呵 也不该你删呀^_^ delete port出错我是这样创建的if (!AfxBeginThread(TCommPort::WatchCommThread,port)) return; I'm Sorry to all,I began two Threads,but only end one ! ~_~ bounds checker工具,如果有正版的最好了。 又是一个用opengl在透明窗口上绘图的问题 看 windows核心编程 时遇到了一个关于线程调度的问题 MFC 分割窗口时, new 后 delete 出错 COM中可以重载运算符吗? Sample Grabber抓到的图像是压缩过的?? 再问CreateFileMapping的共享内存的消息通知问题。 AddNew简单问题,走过,路过,别错过噢! 帮忙!!! 在哪能找到visual assist的注册码? 关于handle的比较问题? 怎么字符串合并呀?40分 简单问题
should do this:
startup :CWinThread* pTheThread = AfxBeginThread(...);destory:
if (pTheThread) delete pTheThread;
CWinThread* pThread = DEBUG_NEW CWinThread(pfnThreadProc, pParam);
_CrtSetBreakAlloc(86);
来看一下到底是在哪分配的内存
TCommPort *port =(TCommPort *) arglist;
这个可能是函数外new的。 却没删。可是。呵呵 也不该你删呀^_^
我是这样创建的
if (!AfxBeginThread(TCommPort::WatchCommThread,port))
return;