hxcpp
hxcpp copied to clipboard
Invalid file name causes "Allocating from a GC-free thread" error
When passing an invalid unicode string to _hx_std_file_contents_string
, instead of giving the Invalid UTF16
error, it gives Critical Error: Allocating from a GC-free thread
.
This is because the exception is thrown by utf8_str()
after hx::EnterGCFreeZone()
is called, so allocating the exception results in the critical error:
https://github.com/HaxeFoundation/hxcpp/blob/86274fdbd8928b1a0872b7a809aa0b98525ae8d3/src/hx/libs/std/File.cpp#L301-L312