mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-03 16:36:25 +00:00
Fixed unknown frees being reported when SDL is built without allocation counts
This commit is contained in:
@@ -295,11 +295,6 @@ void SDLTest_TrackAllocations(void)
|
|||||||
SDLTest_Crc32Init(&s_crc32_context);
|
SDLTest_Crc32Init(&s_crc32_context);
|
||||||
|
|
||||||
s_previous_allocations = SDL_GetNumAllocations();
|
s_previous_allocations = SDL_GetNumAllocations();
|
||||||
if (s_previous_allocations < 0) {
|
|
||||||
SDL_Log("SDL was built without allocation count support, disabling free() validation");
|
|
||||||
} else if (s_previous_allocations != 0) {
|
|
||||||
SDL_Log("SDLTest_TrackAllocations(): There are %d previous allocations, disabling free() validation", s_previous_allocations);
|
|
||||||
}
|
|
||||||
#ifdef SDLTEST_UNWIND_NO_PROC_NAME_BY_IP
|
#ifdef SDLTEST_UNWIND_NO_PROC_NAME_BY_IP
|
||||||
do {
|
do {
|
||||||
/* Don't use SDL_GetHint: SDL_malloc is off limits. */
|
/* Don't use SDL_GetHint: SDL_malloc is off limits. */
|
||||||
@@ -346,6 +341,12 @@ dbghelp_failed:
|
|||||||
SDLTest_TrackedCalloc,
|
SDLTest_TrackedCalloc,
|
||||||
SDLTest_TrackedRealloc,
|
SDLTest_TrackedRealloc,
|
||||||
SDLTest_TrackedFree);
|
SDLTest_TrackedFree);
|
||||||
|
|
||||||
|
if (s_previous_allocations < 0) {
|
||||||
|
SDL_Log("SDL was built without allocation count support, disabling free() validation");
|
||||||
|
} else if (s_previous_allocations != 0) {
|
||||||
|
SDL_Log("SDLTest_TrackAllocations(): There are %d previous allocations, disabling free() validation", s_previous_allocations);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SDLTest_RandFillAllocations(void)
|
void SDLTest_RandFillAllocations(void)
|
||||||
|
Reference in New Issue
Block a user