Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!trwind!venice!press From: press@venice.SEDD.TRW.COM (Barry Press) Newsgroups: comp.windows.ms Subject: Re: WARNING! Serious Memory Leak in MSWindows3.0 - BUG! Keywords: windows microsoft memory leak BUG BUG BUG Message-ID: <1119@venice.SEDD.TRW.COM> Date: 4 Jun 91 21:51:31 GMT References: <1346@cthulhuControl.COM> Reply-To: press@venice.sedd.trw.com (Barry Press) Organization: TRW Systems Engineering & Development Division, Redondo Beach, CA Lines: 26 In programming a number of winapps, I can tell you from experience that the following does occur. If this is indeed responsible for what you're seeing, it's due to a change from win2 to win3 that has not been reflected in all applications. When an application starts, it registers one or more window classes, and then creates windows of those classes. Under win2, you didn't have to do anything special to cause the registrations to go away when your application exited. Under win3, I have seen that applications I've written that do nothing about this issue leave 3 or 4 (as I recall) memory blocks allocated. If, just before the WinMain function returns I do a call to the (new for win3) UnregisterClass function, then those blocks go away. I don't recall how big the blocks were, so can't be sure this is what you're seeing. If it is, however, then the problem is not win3 per se, but a change from win2 to win3 not being understood by all developers. This would be true even for new winapps under win3 -- if you don't unregister the window classes, you'll leave allocated memory. And yes, it only happens on the first execution, since after that the class is either not registered again or else the registration attempt fails (silently, I presume, on the part of the application). -- Barry Press Internet: press@venice.sedd.trw.com