◄CMapStringToOb► ◄Up► ◄Contents► ◄Index► ◄Back► ──Microsoft Foundation Classes────────────────────────────────────────────── void RemoveAll(); Remarks Removes all the elements from this map and destroys the CString key objects. The CObject objects referenced by each key are not destroyed. The RemoveAll function can cause memory leaks if you do not ensure that the referenced CObject objects are destroyed. The function works correctly if the map is already empty. Example { CMapStringToOb map; CAge age1( 13 ); // Two objects on the stack CAge age2( 36 ); map.SetAt( "Bart", &age1 ); map.SetAt( "Homer", &age2 ); ASSERT( map.GetCount() == 2 ); map.RemoveAll(); // CObject pointers removed; objects not removed ASSERT( map.GetCount() == 0 ); ASSERT( map.IsEmpty() ); } // The two CAge objects are deleted when they go out of scope See Also ◄CMapStringToOb::RemoveKey► -♦-