ListControl Leaks Memory
By George Mihaescu
This article is obsolete; the described behavior refers to an
old version of COMCTL32.DLL (implementation of Windows Common Controls)
installed by IE 4 and the problem was fixed in subsequent versions of this DLL.
The code demonstrating the problem was removed because we could
not reproduce this problem anymore; this article will be removed soon.
Summary: The Win32 List Control leaks memory in
report mode, when columns are deleted. If adding then deleting column the
memory used internally by the control to store that column’s name is not freed,
resulting in a leak of a block with a byte size equal to the length of the
column name.
Therefore, if in a list control the columns are added and
deleted repeatedly this will lead to a memory leak.
This behavior has been observed in Win32 on WinNT Service
pack 3, using MFC, but the problem was tracked down into the actual Windows
control.