Files
Goober5000andClaude Opus 4.6 4a4ca20481 Fix crash when restarting mongoose server on Windows
mg_start() calls InitializeCriticalSection(&global_log_file_lock) on
every invocation, but mg_stop() never calls DeleteCriticalSection.
Re-initializing an already-initialized critical section is undefined
behavior on Windows and corrupts the heap, causing the next allocation
to throw an exception.

Make the Win32 initialization (WSAStartup + InitializeCriticalSection)
one-shot via a static flag, and remove the asymmetric WSACleanup from
mg_stop so resources remain valid across mg_start/mg_stop cycles.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-04-01 13:25:36 -04:00
..
2016-07-22 12:07:19 +02:00
2016-07-22 12:07:19 +02:00
2016-07-22 12:07:19 +02:00