Open
Description
Pool arrays created in gdscript and passed to gdnative module are leaking. Or am I missing something and pool arrays should be freed manually?
gdnative module code:
void GDNObj::set_data(const PoolByteArray p_data) {
if (p_data.size() == 0)
return;
if (data)
std::free(data);
data = std::malloc(p_data.size());
std::memcpy(data, p_data.read().ptr(), p_data.size());
}
gdscript code:
func _ready():
var gdn_obj = GDNObj.new()
var bytes = PoolByteArray([0x41, 0x00, ... , 0x74, 0x00])
gdb_obj.set_data(bytes)
Results in following error message at exit:
ERROR: cleanup: There are still MemoryPool allocs in use at exit!
At: core/dvector.cpp:70.