If you are using wxwidgets in your project you might want to take a look at wx\include\msw\setup.h, there you can define that you want to debug your allocated memory. This works very well for me, altough I'm not sure if it will work with mingw at all (there is a comment within setup.h about mingw). Set wxUSE_DEBUG_CONTEXT, wxUSE_MEMORY_TRACING, wxUSE_GLOBAL_MEMORY_OPERATORS and wxUSE_DEBUG_NEW_ALWAYS to 1 and you should get some debug output (use a debugger to see these messages) if you forget to free any objects on the heap (with sourcefile and linenumber where you allocated them). Of course you need to compile the library and your program with __WXDEBUG__ enabled.