An extremely common mistake is to forget that the functions:
Rwvistream& operator>>(RWvistream&, RWCollectable*&); RWFile& operator>>(RWFile&, RWCollectable*&);
return their results off the heap. This can result in a memory leak like the following:
main(){ RWCollectableString* string = new RWCollectableString; RWFile file("mydata.dat"); // WRONG: file >> string; // Memory leak! // RIGHT: delete string; file >> string; }