内存泄漏的问题!?高分!!
static AFX_EXTENSION_MODULE extensionDLL;
extern "C" int APIENTRY
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
// Extension DLL one-time initialization
if (!AfxInitExtensionModule( extensionDLL, hInstance))
return 0;
// TODO: perform other initialization tasks here
//***********
new CDynLinkLibrary(extensionDLL);
//***********
}
else if (dwReason == DLL_PROCESS_DETACH)
{
// Extension DLL per-process termination
AfxTermExtensionModule(extensionDLL);
// TODO: perform other cleanup tasks here
}
return 1; // ok
}
***************************
new CDynLinkLibrary(extensionDLL); 这句话new出来的对象需要释放吗?为什么?
小弟初学者,请多指教,先谢过啦!