mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-18 23:07:07 -05:00
libc implements the C++ exception runtime and already defines exception_ptr's out-of-line members, so host modules that link libc reference-count libc's exceptions. Code inside libstdc++-6.dll does not see those definitions on Windows: std::__future_base::_Result_base's destructor is one of them, and it releases the stored exception with libstdc++'s own exception_ptr::_M_release. That decrements a count 0xa0 bytes before the object, while libc keeps it 0x80 bytes before, so the decrement lands in the heap memory in front of libc's allocation and the exception is never freed. VideoOutDriver reports the presentation thread's start-up failure through a std::promise, so video_out_flip_lifetime sometimes ended with 0xc0000374 when SDL's offscreen driver refused the window. libc now defines the base destructor, with a _nid_postfix twin so that the NID-patched libc keeps its name, and modules bind it there.