Three (3) List classes to prevent memory leaks

Here are two template classes and one normal class designed
to prevent memory leaks.

CMyList (template)
This class is a wrapper for the CList MFC template class. It adds
extra functionality and allows its member items to serialise
themselves (important for schema versioning).

CMyTypedPtrList (template) my personal favourate
This class is a wrapper for the CTypedPtrList MFC template class.
The items pointed to will be properly deleted thus causing no memory
leaks.

CMyObList (standard class)
This class is a wrapper for the CObList MFC class.
The items pointed to will be properly deleted thus causing no memory
leaks.

Downloads

Download demo project – 9 Kb
Download source – 3 Kb

History

More by Author

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Must Read