I am making a window C++ class and I am using extra bytes for each window created (using the cbWndExtra of the WNDCLASSEX struct, etc) when registering the window class. Does ::DestroyWindow(..) release the allocated window's extra bytes?
It seems that when I create and destroy many window objects in a loop the "Commit Size" of my app in Task Manager rises.
My C++ class does not allocate any memory, moreover it has no controls/toolbars/menus on it, it does not seem to leak any GDI objects or anything like that, so I suspect it is something with the extra bytes of the window.
Does anyone have any ideas on what can be going wrong?
Is there some API I should call to release the extra bytes?
Is there something else you must do when destroying a window that is using extra bytes?
EDIT: I did try creating just a single window of the specific class that uses the extra bytes and destroying it in a loop and, again, the commit size of my app rises. I also waited for a few hours and the the commit size didn't decrease at all. The extra bytes contain only a pointer to the object that represents the window. This object gets destroyed (it is created statically in the loop). Anyway, it seems that it's not my fault and that it might not even be a bug of Windows (as you say - although I'm not 100% sure) so I'm about to leave it as is...