forked from Mirrors/openclonk
stringtable: Destroy strings before the set containing them
So that they can remove themselves from the set,
parent
a03f849a4f
commit
40e2406a03
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue