1616#include " GameExecutablePatcher.h"
1717#include " FileGenerator.h"
1818#include " FileSystem.h"
19+ #include " SharedUtil.Memory.h"
1920
2021namespace fs = std::filesystem;
2122
@@ -418,9 +419,10 @@ SString CInstallManager::_ShowCrashFailDialog()
418419 SetApplicationSetting (" diagnostics" , " gta-fopen-fail" , GetApplicationSetting (" diagnostics" , " gta-fopen-last" ));
419420 SetApplicationSetting (" diagnostics" , " gta-fopen-last" , " " );
420421
421- SString strMessage = GetApplicationSetting (" diagnostics" , " last-crash-info" );
422422 SString strReason = GetApplicationSetting (" diagnostics" , " last-crash-reason" );
423423 SetApplicationSetting (" diagnostics" , " last-crash-reason" , " " );
424+
425+ SString strMessage = GetApplicationSetting (" diagnostics" , " last-crash-info" );
424426 if (strReason == " direct3ddevice-reset" )
425427 {
426428 strMessage += _ (" ** The crash was caused by a graphics driver error **\n\n ** Please update your graphics drivers **" );
@@ -430,6 +432,15 @@ SString CInstallManager::_ShowCrashFailDialog()
430432 strMessage += strReason;
431433 }
432434
435+ const SString moduleName = GetApplicationSetting (" diagnostics" , " last-crash-module" );
436+ const int exceptionCode = GetApplicationSettingInt (" diagnostics" , " last-crash-code" );
437+
438+ if (exceptionCode == CUSTOM_EXCEPTION_CODE_OOM && moduleName.EndsWithI (" \\ kernelbase.dll" ))
439+ {
440+ strMessage += ' \n ' ;
441+ strMessage += _ (" ** Out of memory - this crash was caused by insufficient free or fragmented memory. **" );
442+ }
443+
433444 strMessage = strMessage.Replace (" \r " , " " ).Replace (" \n " , " \r\n " );
434445 SString strResult = ShowCrashedDialog (g_hInstance, strMessage);
435446 HideCrashedDialog ();
0 commit comments