首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

这样是否会出现内存泄露解决方法

2012-03-31 
这样是否会出现内存泄露C/C++ code............int a[3]int i0do{coutplease enter a variable:ci

这样是否会出现内存泄露

C/C++ code
............int a[3];int i=0;do{   cout<<"please enter a variable:";  cin>>a[i];  i++;    }while(i<3);........................int a[3];int i=0;do{   cout<<"please enter a variable:";  cin>>a[i];  i++;    }while(i<3);............;do{   cout<<"please enter a variable:";  cin>>a[i];  i++;    }while(i<3);............


这样调用
CWork::StartTask(hWnd);
释放
CWork::Release();

[解决办法]
会的
release之后delete对象
[解决办法]
不要用_endthread结束线程,直接return返回,然后CloseHandle
_endthread and _endthreadex cause C++ destructors pending in the thread not to be called.

另外,你这个写的有问题,如果StartWork两次或以上的话……

热点排行