Skip to content

Commit f2645c2

Browse files
committed
windows: Enable heap terminate-on-corruption
This is default behavior from Windows 8 onwards, however we still support Windows 7, so it should make sense to explicitly enable this. More info: https://docs.microsoft.com/en-us/windows/win32/api/heapapi/nf-heapapi-heapsetinformation
1 parent e258ce7 commit f2645c2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/init.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,9 @@ bool AppInitBasicSetup()
879879
#ifdef WIN32
880880
// Enable Data Execution Prevention (DEP)
881881
SetProcessDEPPolicy(PROCESS_DEP_ENABLE);
882+
883+
// Enable heap terminate-on-corruption
884+
HeapSetInformation(nullptr, HeapEnableTerminationOnCorruption, nullptr, 0);
882885
#endif
883886

884887
if (!SetupNetworking())

0 commit comments

Comments
 (0)