16
16
#include " GameExecutablePatcher.h"
17
17
#include " FileGenerator.h"
18
18
#include " FileSystem.h"
19
+ #include " SharedUtil.Memory.h"
19
20
20
21
namespace fs = std::filesystem;
21
22
@@ -418,9 +419,10 @@ SString CInstallManager::_ShowCrashFailDialog()
418
419
SetApplicationSetting (" diagnostics" , " gta-fopen-fail" , GetApplicationSetting (" diagnostics" , " gta-fopen-last" ));
419
420
SetApplicationSetting (" diagnostics" , " gta-fopen-last" , " " );
420
421
421
- SString strMessage = GetApplicationSetting (" diagnostics" , " last-crash-info" );
422
422
SString strReason = GetApplicationSetting (" diagnostics" , " last-crash-reason" );
423
423
SetApplicationSetting (" diagnostics" , " last-crash-reason" , " " );
424
+
425
+ SString strMessage = GetApplicationSetting (" diagnostics" , " last-crash-info" );
424
426
if (strReason == " direct3ddevice-reset" )
425
427
{
426
428
strMessage += _ (" ** The crash was caused by a graphics driver error **\n\n ** Please update your graphics drivers **" );
@@ -430,6 +432,15 @@ SString CInstallManager::_ShowCrashFailDialog()
430
432
strMessage += strReason;
431
433
}
432
434
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
+
433
444
strMessage = strMessage.Replace (" \r " , " " ).Replace (" \n " , " \r\n " );
434
445
SString strResult = ShowCrashedDialog (g_hInstance, strMessage);
435
446
HideCrashedDialog ();
0 commit comments