stringtable: Destroy strings before the set containing them

So that they can remove themselves from the set,
Günther Brammer 2011-01-07 00:52:53 +01:00
parent a03f849a4f
commit 40e2406a03
2 changed files with 4 additions and 2 deletions

View File

@ -176,7 +176,6 @@ C4StringTable::~C4StringTable()
}
#endif
assert(Set.GetSize() == P_LAST);
for (unsigned int i = 0; i < P_LAST; ++i) P[i].Data.Clear();
}
C4String *C4StringTable::RegString(StdStrBuf String)

View File

@ -264,10 +264,13 @@ public:
// Find existing C4String
C4String *FindString(const char *strString);
C4String P[P_LAST];
private:
C4Set<C4String *> Set;
friend class C4String;
public:
// After the set, so these are destroyed with the set still alive
C4String P[P_LAST];
};
extern C4StringTable Strings;