Skip to content

Commit

Permalink
TestSuite: better document using DebugCrtInit().
Browse files Browse the repository at this point in the history
  • Loading branch information
ocornut committed Dec 19, 2024
1 parent 5fb8258 commit 2c52d6d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions imgui_test_suite/imgui_test_suite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
// Includes & Compiler Stuff
//-------------------------------------------------------------------------

// See DebugCrtInit() call to break on a specific alloc
// [Windows] See DebugCrtInit() call in main() to debug/break on a specific alloc
#ifdef _WIN32
#define DEBUG_CRT
#define _CRTDBG_MAP_ALLOC
Expand Down Expand Up @@ -69,6 +69,7 @@
// Allocators
//-------------------------------------------------------------------------

// [Windows] See DebugCrtInit() call in main() to debug/break on a specific alloc
static void* MallocWrapper(size_t size, void* user_data) { IM_UNUSED(user_data); return malloc(size); }
static void FreeWrapper(void* ptr, void* user_data) { IM_UNUSED(user_data); free(ptr); }

Expand Down Expand Up @@ -389,7 +390,7 @@ static inline void DebugCrtDumpLeaks()
int main(int argc, char** argv)
{
#ifdef DEBUG_CRT
DebugCrtInit(0);
DebugCrtInit(0); // <-- Insert allocation # here to debug break
#endif

TestSuiteApp GAppInstance;
Expand Down

0 comments on commit 2c52d6d

Please sign in to comment.