Code: Select all
class TestClass
{
public int x;
public String str;
public void Print()
{
PrintLn(x);
PrintLn(str);
}
}
void test_serialize_map()
{
File f;
Map<String, TestClass> data { };
data["BobsScore"] = TestClass {1,"1-1"};
f = FileOpen("savedstuff", write);
f.Put(data);
delete f;
delete data;
f = FileOpen("savedstuff", read);
f.Get(data);
delete f;
{
TestClass t = data["BobsScore"]; //SIGSEGV happened here
//how to resolve the SIGSEGV problem ?
t.Print();
delete t;
}
}
class TestApp : Application
{
void Main()
{
test_serialize_map();
}
}