fix table archive

This commit is contained in:
Christopher Lackner 2021-07-17 13:35:01 +02:00
parent 6f044faaba
commit 300835a446

View File

@ -171,7 +171,19 @@ namespace ngcore
void DoArchive(Archive& ar)
{
ar & size;
if(size == 0)
return;
if(ar.Input())
{
index = new IndexType[size+1];
mt.Alloc(sizeof(IndexType) * (size+1));
}
ar.Do(index, size+1);
if(ar.Input())
{
data = new T[index[size]];
mt.Alloc(sizeof(T) * index[size]);
}
ar.Do(data, index[size]);
}