在 2025-12-13 22:32, Luca Bacci 写道:
 From the commit message:


The Windows CRT flushes all stdio streams open for output
within its DllMain handler. This is not quite safe:

1. A DLL may acquire locks on process termination, which can
    cause instant termination.
2. The flushing operation itself must acquire locks, which goes
    against the rules for DllMain on process termination.

This commit adds an atexit handler that flushes all output streams
before ExitProcess is called. This should also help with execution
environments where ExitProcess behaves like TerminateProcess (see
AppPolicyGetProcessTerminationMethod).

Follow-up from https://github.com/msys2/MINGW-packages/issues/26646

This idea sounds correct. However I think you can just do `_crt_atexit((_PVFV)(intptr_t) _flushall)` without introducing a new function, and it needs to be moved somewhere before `__main()`.




--
Best regards,
LIU Hao

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to