hxcpp icon indicating copy to clipboard operation
hxcpp copied to clipboard

Invalid file name causes "Allocating from a GC-free thread" error

Open tobil4sk opened this issue 1 year ago • 0 comments

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

tobil4sk avatar Apr 16 '23 21:04 tobil4sk