Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

False memory leaks in MFC

Is there someone who uses OpenCV in the MFC application? I don't believe that I am the only person on the world who is using this combination. I have really annoying problem with false memory leaks. It is impossible to detect any real memory leak because false memory leak report is huge. I tried everything what I found on the internet but nothing works.

I tried:

  • OpenCV 2.4, 3.0, 3.1. 3.2
  • DLL, static libs
  • Delay Loaded Dlls
  • Load MFC maualy before OpenCV Dlls

Nothing works. Still the same result. I'm out of ideas what to try. It is impossible to debug my application with these false memory leaks.

Please, Is there someone who is using Opencv and MFC without problem?

For example:

Code:

   #include <opencv2/core.hpp>
    ...    
    void OCVLeakTestDlg::OnBnClickedButton1()
    {
             cv::Mat m1(100,100,CV_8U);
    }
    ...

Result:

Detected memory leaks!
Dumping objects ->
{84} normal block at 0x003A58A0, 28 bytes long.
 Data: < X:             > D8 58 3A 00 FF FF FF FF 00 00 00 00 00 00 00 00 
{83} normal block at 0x003A5860, 4 bytes long.
 Data: < X: > A0 58 3A 00 
Object dump complete.
The program '[4204] OCVLeakTest.exe' has exited with code 0 (0x0).