Merge branch 'archive_table' into 'master'

fix table archive

See merge request jschoeberl/netgen!397
This commit is contained in:
Christopher Lackner 2021-07-17 12:07:18 +00:00
commit 487c32bbb4

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]);
}