STArray cannot use a vector of STObject's because bad things happen when you delete them.

This commit is contained in:
JoelKatz
2012-11-26 11:20:12 -08:00
parent f5018b6cd1
commit 6013d994e2
2 changed files with 17 additions and 8 deletions

View File

@@ -934,7 +934,7 @@ STArray* STArray::construct(SerializerIterator& sit, SField::ref field)
throw std::runtime_error("Unknown field");
}
value.push_back(STObject(fn));
value.push_back(new STObject(fn));
value.rbegin()->set(sit, 1);
}
@@ -1234,6 +1234,9 @@ BOOST_AUTO_TEST_SUITE(SerializedObject)
BOOST_AUTO_TEST_CASE( FieldManipulation_test )
{
if (sfGeneric.isUseful())
BOOST_FAIL("sfGeneric must not be useful");
SField sfTestVL(STI_VL, 255, "TestVL");
SField sfTestH256(STI_HASH256, 255, "TestH256");
SField sfTestU32(STI_UINT32, 255, "TestU32");