My C++ host application included my haxe static library and call hxRunLibrary(), I have try "new" a haxe class, or get an instance new in haxe (objectPtr and cast), and forever call testLeak()
package;
class HaxeLibrary{
public static function main(){}
public function new(){}
public function testLeak():Int{
var world2:World2 = new World2();
return 0;
}
}
I got an error below:
0 0x000000000042484e hx::MarkAllocUnchecked(void*, hx::MarkContext*)
1 0x0000000000433f4b hx::Class_obj::__Mark(hx::MarkContext*)
2 0x00000000004950ef GlobalAllocator::ThreadLoop(int)
3 0x0000000000495d02 GlobalAllocator::SThreadLoop(void*)
4 0x00000000771259cd KERNEL32!BaseThreadInitThunk
5 0x000000007725a2e1 ntdll!RtlUserThreadStart
6 0x0000000000000000 ??
I found that AutoGCRoot but not enough knowledge of how to convert between haxe ObjectPtr and haxe value.