c++ - Memory leak on CreateErrorInfo when analyze from debugdiag? -


I am analyzing the memory dump generated by debugdiag. I shows the CreateErrorinfo method call which is similar to the memory leak ,

I am using proper map files for both mydll and myanotherdll. What does CreateErrorInfo mean? How is it leading to memory leak?

Function Source Destination mfc90u! Operator new + 33
mfc90u! CPlex :: Create + 1f mfc90u! Operator new kernel32! TlsSetValueStub
kernel32! TlsSetValueStub
MYANOTHERDLL ! CreateErrorInfo + 188e2
MYDLL! MyClas :: OnTimer + a3 ...... \ myfile.cpp @ 4639
MYDLL! CMainFrame :: OnTimer + 71 ...... \ mainfrm.cpp @ 1246
mfc90u! CWnd :: OnWndMsg + 407
mfc90u! AfxCallWndProc + a3
User 32! MDICLTEDPDWMM! MCDLLDU! __SSE2_ Available_inited + 657b
MFC 90U! CWND :: WindowPro +24
MFCU! FxCollwide Proc + A3
MFCCD! FxWandPro + 37 MFCCD! Fxcollwand Prakr Mfcd! FxWrapCrabbase + 56MFCDUFXWdProppiMfC90U! AfxWndProcBase

Is it not related to not issuing an interface? Interfaces from manufacturer IrroInfo should be issued by the client:

  iccetarwinfo * pErrorInfo = nullptr; HRESULT hr = :: CreateErrorInfo (& amp; pErrorInfo); If (pErrorInfo) {pErrorInfo-> Release (); }   

Better to use ATL's smart pointers:

  CComPtr & lt; ICreateErrorInfo & gt; PtrErrorInfo; HRESULT hr = :: CreateErrorInfo (& amp; ptrErrorInfo); If (ptrErrorInfo) {// requires a release}    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -