Dr. Memory 로그에 약 2899 회의 횟수로 3 개의 오류가 있음을 알 수 있습니다. 오류는 다음과 같습니다
Error # 154: 2899
Error # 155: 2899
Error # 369: 2898
그래서, 당신은 오류를 보면 : 당신이 어떤 루프에서 새로운 메모리를 할당하지만, 할당을 해제 잊어 버린 것으로 보인다
Error #154: GDI USAGE ERROR: same bitmap 0x46052c24 selected into two different DC's 0x08012c43 and 0xbe012c3e
# 0 SDL.dll!SDL_UnregisterApp +0x3063 (0x681304c3 <SDL.dll+0x304c3>)
# 1 SDL.dll!SDL_UpdateRect +0x69 (0x68125d7a <SDL.dll+0x25d7a>)
# 2 SDL.dll!SDL_Flip +0x52 (0x68125ff3 <SDL.dll+0x25ff3>)
# 3 draw() [L:/git/snake/src/main.cpp:133]
# 4 SDL_main [L:/git/snake/src/main.cpp:92]
# 5 console_main [./src/main/win32/SDL_win32_main.c:315]
# 6 [email protected] [./src/main/win32/SDL_win32_main.c:398]
# 7 main [L:/git/snake/src/main.cpp:211]
Note: @0:00:04.148 in thread 3940
Error #155: GDI USAGE ERROR: DC 0x08012c43 that contains selected object being deleted
# 0 system call NtGdiDeleteObjectApp
# 1 GDI32.dll!DeleteDC +0xb6 (0x75b1596a <GDI32.dll+0x1596a>)
# 2 GDI32.dll!DeleteDC +0x11 (0x75b158c5 <GDI32.dll+0x158c5>)
# 3 SDL.dll!SDL_UnregisterApp +0x30c9 (0x6813052a <SDL.dll+0x3052a>)
# 4 SDL.dll!SDL_UpdateRect +0x69 (0x68125d7a <SDL.dll+0x25d7a>)
# 5 SDL.dll!SDL_Flip +0x52 (0x68125ff3 <SDL.dll+0x25ff3>)
# 6 draw() [L:/git/snake/src/main.cpp:133]
# 7 SDL_main [L:/git/snake/src/main.cpp:92]
# 8 console_main [./src/main/win32/SDL_win32_main.c:315]
# 9 [email protected] [./src/main/win32/SDL_win32_main.c:398]
#10 main [L:/git/snake/src/main.cpp:211]
Note: @0:00:04.149 in thread 3940
Error #369: LEAK 60 direct bytes 0x04c09070-0x04c090ac + 0 indirect bytes
# 0 SDL.dll!SDL_CreateRGBSurface +0x8a (0x681250cb <SDL.dll+0x250cb>)
# 1 SDL_ttf.dll!TTF_RenderUNICODE_Solid +0xa6 (0x6f4c2e87 <SDL_ttf.dll+0x2e87>)
# 2 SDL_ttf.dll!TTF_RenderText_Solid +0x62 (0x6f4c3253 <SDL_ttf.dll+0x3253>)
# 3 draw() [L:/git/snake/src/main.cpp:130]
# 4 SDL_main [L:/git/snake/src/main.cpp:92]
# 5 console_main [./src/main/win32/SDL_win32_main.c:315]
# 6 [email protected] [./src/main/win32/SDL_win32_main.c:398]
# 7 main [L:/git/snake/src/main.cpp:211]
.
LEAK로 표시된 오류 # 369의 경우 : TTF_RenderText_Solid()
을 호출 한 후 SDL_FreeSurface()
으로 전화해야합니다.
아마도 리눅스로 전환하고'valgrind'를 사용할 것입니까? –
아마도 일부 코드 .. 그것은 많은 메모리 누수가있는 로그에 따라 루프 문제 – iKlsR
처럼 들립니다. 예를 들어 여기에 무엇이 있는지 살펴보십시오 : # 5 load_image() [L : /git/snake/src/main.cpp : 144] # 6 load_files() [L :/git/snake/src/main. cpp : 192]' – varnie