From 300835a44655f2d391612141c12d52501ae0c19d Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Sat, 17 Jul 2021 13:35:01 +0200 Subject: [PATCH] fix table archive --- libsrc/core/table.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libsrc/core/table.hpp b/libsrc/core/table.hpp index ad0c73a1..62c6e5b9 100644 --- a/libsrc/core/table.hpp +++ b/libsrc/core/table.hpp @@ -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]); }