1
mirror of https://github.com/mpv-player/mpv synced 2024-08-08 13:25:45 +02:00

w32: enable heap corruption detection

Enable the terminate-on-corruption feature. This is recommended for new
Windows applications and shouldn't cause a performance hit. It actually
shouldn't change anything for 64-bit builds, since Win64 has this
switched on by default.

See:
http://blogs.msdn.com/b/michael_howard/archive/2008/02/18/faq-about-heapsetinformation-in-windows-vista-and-heap-based-buffer-overruns.aspx
This commit is contained in:
James Ross-Gowan 2014-01-07 23:17:44 +11:00 committed by wm4
parent c3bcc12a3c
commit 4c83a93617

View File

@ -262,6 +262,9 @@ static void osdep_preinit(int *p_argc, char ***p_argv)
#if defined(__MINGW32__) || defined(__CYGWIN__)
// stop Windows from showing all kinds of annoying error dialogs
SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
// Enable heap corruption detection
HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);
#endif
terminal_init();