We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c354bcb commit 3e55f23Copy full SHA for 3e55f23
lib/DxcSupport/dxcmem.cpp
@@ -58,6 +58,12 @@ void DxcCleanupThreadMalloc() throw() {
58
59
IMalloc *DxcGetThreadMallocNoRef() throw() {
60
if (g_ThreadMallocTls == nullptr) {
61
+ // Some genious didn't take into account that when CRT starts up,
62
+ // a static std::ferr is initialized whichg calls `new locale`.
63
+ // And if you're overriding the `new`&`delete` operators globally,
64
+ // its nice to not have them depend on global state or deference nullptrs.
65
+ if (!g_pDefaultMalloc)
66
+ CoGetMalloc(1, &g_pDefaultMalloc);
67
return g_pDefaultMalloc;
68
}
69
0 commit comments