- [Trigger editor]
DataTableInstanceValueName
definition lacks return type. It should returnstring
, instead ofvoid
. - [Trigger editor]
DataTableInstanceGetUnitRef
has incorrect macro definition.
Currently it is:
UnitRefToUnit(DataTableInstanceGetUnitRef(#PARAM(scope), #PARAM(name)))
While it should be:
UnitRefToUnit(DataTableInstanceGetUnitRef(#PARAM(instance), #PARAM(name)))
- It seems it’s impossible to destroy previously created datatable instance.
DataTableInstanceDestroy
function is missing. - Data table instance is leaking memory. Tested with following code:
void datatable_test()
{
int i;
int dti;
for (i = 0; i < 1000000; i += 1) {
DataTableInstanceCreate();
dti = DataTableInstanceLastCreated();
DataTableInstanceSetString(dti, "k" + IntToString(i), "v");
}
}
It allocates over 500MB which is never reclaimed (once we quit the sc2map). Restarting the same map multiple times will ultimately lead to Core: out of memory
crash.