Initialize MEMORYSTATUSEX size before GlobalMemoryStatusEx() (thanks, Justin!).

Fixes Bugzilla #2177.
main
Ryan C. Gordon 2013-10-23 19:52:14 -04:00
parent 51fc4b202e
commit 72de99aed3
1 changed files with 1 additions and 0 deletions

View File

@ -642,6 +642,7 @@ SDL_GetSystemRAM(void)
#ifdef __WIN32__
if (SDL_SystemRAM <= 0) {
MEMORYSTATUSEX stat;
stat.dwLength = sizeof(stat);
if (GlobalMemoryStatusEx(&stat)) {
SDL_SystemRAM = (int)(stat.ullTotalPhys / (1024 * 1024));
}