Most libraries don't bother with trapping memory leaks - not so with TnFOX! Of course this is no substitute for valgrind on Linux, but it's good enough to catch most leaks.
If you wish to trap memory leaks, include this code after all other include's in your C++ file but before the main body:
#include <FXMemDbg.h> #if defined(DEBUG) && !defined(FXMEMDBG_DISABLE) static const char *_fxmemdbg_current_file_ = __FILE__; #endif
If you need to undo the allocator macro definitions, simply wrap the relevant code with include <FXMemDbg.h> e.g.
#include <FXMemDbg.h> #if defined(DEBUG) && !defined(FXMEMDBG_DISABLE) static const char *_fxmemdbg_current_file_ = __FILE__; #endif ... redefinitions are turned on ... #include <FXMemDbg.h> Redefinitions are now turned off obj = new(heap, 32) AlignedObject; #include <FXMemDbg.h> Redefinitions are now turned on again
Definition in file FXMemDbg.h.
Go to the source code of this file.