用ACE:init()会导致内存泄漏?

bluecrest 2005-05-09 08:46:02
BOOL CAbccltApp::InitInstance()
{
ACE::init();


AfxEnableControlContainer();

// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.

#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif

CAbccltDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}

// task1.stop();

ACE::fini();
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}

只要调用ACE:init();就会导致内存泄漏?

Detected memory leaks!
Dumping objects ->
{61} normal block at 0x008B47C8, 6 bytes long.
Data: < > 00 00 00 00 00 00
{47} normal block at 0x008B4200, 33 bytes long.
Data: < C > 00 43 00 CD CD CD CD CD CD CD CD CD CD CD CD CD
{46} normal block at 0x008B2C88, 40 bytes long.
Data: < |L > 14 7C 4C 10 16 00 00 00 00 00 00 00 00 00 00 00
Object dump complete.
The thread 0x3F4 has exited with code 2 (0x2).
...全文
161 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
bluecrest 2005-05-27
  • 打赏
  • 举报
回复
原因需要定义ACE_HAS_MFC 1
xuwedo2003 2005-05-20
  • 打赏
  • 举报
回复
没用过。
windoze 2005-05-09
  • 打赏
  • 举报
回复
一次性泄漏不算泄露,一次性泄漏嘛,程序的事情,怎么能算泄漏呢?
再说,ACE::init干了那么多事,让人家泄漏一点吧,不然怎么说得过去?

结论:用新版ACE。

24,854

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧