0

I'm receiving the error message shown on the following figure. This error pops up at the very end of my C++ code when main.cpp goes beyond return 0; it means just when the executable wants to exit. I'm not sure why this error is happening. Does anybody know what the reason can be?

I'm using Microsoft COM classes in my C++ code. Maybe the error is due to the fact that these libraries are not unloaded after return 0;. Is there any command to unload all the loaded libraries (explicitly or implicitly) at the end of the main.cpp?

I have shown below my main.cpp. I think the error is because I don't use the delete after new inside my main.cpp I'm not sure.

enter image description here

enter image description here

enter image description here

Megidd
  • 7,089
  • 6
  • 65
  • 142
  • 1
    Do you have any global or local static variables? If so, are any of them an instance of a class you created? If so, what are you doing in the destructor? – Some programmer dude Sep 26 '14 at 15:13
  • 2
    It seems you are using a pointer that is in freed heap memory. http://stackoverflow.com/questions/127386/in-visual-studio-c-what-are-the-memory-allocation-representations – drescherjm Sep 26 '14 at 15:14
  • @JoachimPileborg I showed my `main.cpp` on the question above can you please take a look at it. – Megidd Sep 26 '14 at 15:18
  • @drescherjm I showed my `main.cpp` on the question above. Can you take a look at it? – Megidd Sep 26 '14 at 15:24
  • 2
    I say the problem is not in your main.cpp. It's in your CMS class. – drescherjm Sep 26 '14 at 15:29
  • 1
    0xfeeefeee is a magic number, it tells you that you are accessing memory that was allocated from the heap but was released. – Hans Passant Sep 26 '14 at 17:14

0 Answers0