Questionable use of theard.Thread creat using CreatThread rather than _beginthread.
Boundschecker的详细说明如下:
A thread, which makes calls to one or more run-time library functions, was created using CreateThread. A thread that uses functions from the C run-time libraries should use the _beginthread and _endthread C run-time functions for thread management rather than CreateThread and ExitThread. Failure to do so results in small memory leaks when ExitThread is called.Note: If the run-time library is statically linked and the module lacks debug info, it may not be possible for the call to _beginthread to be detected and this error is reported. In this situation, the error can be safely suppressed.我不知道实时库函数和c实时库的函数有什么区别?而且我还没开新线程就已经检测出错误了。我用的
AfxBeginThread();开启线程,属于上面哪一类?请高手执教!
Boundschecker的详细说明如下:
A thread, which makes calls to one or more run-time library functions, was created using CreateThread. A thread that uses functions from the C run-time libraries should use the _beginthread and _endthread C run-time functions for thread management rather than CreateThread and ExitThread. Failure to do so results in small memory leaks when ExitThread is called.Note: If the run-time library is statically linked and the module lacks debug info, it may not be possible for the call to _beginthread to be detected and this error is reported. In this situation, the error can be safely suppressed.我不知道实时库函数和c实时库的函数有什么区别?而且我还没开新线程就已经检测出错误了。我用的
AfxBeginThread();开启线程,属于上面哪一类?请高手执教!
解决方案 »
- vc6突然不正常了,产生的.exe会让机器一下好慢。windows程序设计书上的例子
- 对话框控件数据打印的一段程序有错误,帮忙看下
- 帮我修改一下一个基类内存使用不断增加问题
- windows 编程一个简单问题
- MFC CObList类问题,急 在线等!!!
- 请问如何用MFC做一个对话框A,点击A的按钮关闭对话框A然后弹出对话框B?
- ADO,用pRecordset->GetCollect("ColNam")后返回不正确的字符串
- treectrl重绘的问题
- 本来完全正常的dll没做过任何修改,在调用时突然出现access violation,请问何故?
- 跪求harris特征点匹配的vc源代码
- 关于Socket"目标机器积极拒绝"的问题,高手指点,多谢!
- [讨论]这个网络问题有点难度,关于重定向程序!
好像AfxBeginThread有时是会提示有泄漏,设置m_bAutoDelete = TRUE;
vcleaner(我没当大哥很久了.......) :谢谢指点!请问什么是c运行期函数?
有一个调用了C运行时函数的线程,是用CREATETHREAD创建的.需要调用C运行时的线程应该使用 _beginthread 和 _endthread 来创建和结束,而不是用 CreateThread 和 ExitThread.如果不这样,那么在 调用 ExitThread 的时候会有内存泄漏.
总之,你最好使用 _beginthread 来创建线程,而不是AFXBEGINTHREAD和createthread.
另外,_endthread会在线程退出时被自动调用,你不需要手动调用.