Re: [Plib-devel] Memory leaks, was: GL_COLOR_MATERIAL pitfall
Brought to you by:
sjbaker
From: <Va...@t-...> - 2000-05-01 07:12:54
|
Steve Baker wrote: > > I think what you are talking about in MSVC is the issue of memory > that the application allocated but did not free when the program > exited. This (if true) is a M$ peculiarity. "Proper" operating > systems know what memory an application used during it's run and > automagically reclaim it. This isn't true. Even the old DOS freed the memory. (To get sure I just wrote a program that allocated 1 MB and didn't free it. As soon as it quit itself the memory was freed) > > At the moment I can only say that a lot of memory blocks are leaked if > > I just start PPE and close it right away. > > I don't consider that a bug though...(although maybe Windoze finds > it serious and we have to fix it anyway). This doesn't really need a fix as it's not a problem - at least not in our case. I once reused an old C program (it had the foo( x, y ) int x; float y; { ... } style - argh) that didn't free any memory. If I would have used it as a standalone program (as it was designed for) it wouldn't have mattered. But I used it as a part of a bigger program (FGFS) and thus it was an issue. As the programming style was that bad that you really couldn't figure out what each part was doing and anny attemt to fix the leakes resulted in braking its functionality I replaced all mallocs with my_malloc that kept track of the allocations and freed themselfs when they weren't used. Although it didn't have an leak afterwards I was happy to replace it later as such an ugly code shouldn't be redistributed. CU, Christian |