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 such as the following:
int main(){ RWCollectableString* string = new RWCollectableString; RWFile file("mydata.dat"); // WRONG: file >> string; // Memory leak! // RIGHT: delete string; file >> string; return 0; }
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.