Re: [Plib-devel] Memory leaks, was: GL_COLOR_MATERIAL pitfall
Brought to you by:
sjbaker
From: Wolfram K. <w_...@rz...> - 2000-05-01 12:06:41
|
Warning: Of topic (about Windo$ memory leak detection tools). Dave wrote: >I recommend using "NuMega BoundsChecker" with Visual C++. I have written a modeler we use as an in-house-tool. I have to admit that I never got rid of all the mem leaks :-(. Until now I used the tools of Windo$/MSVC to find them. These are quite ok in some respects, for example, they find and print all the leaked blocks. With a bit of effort you can get MSVC to tell you exactly where the block was allocated. However, this only works in some instances. I never completely understood, in which. I have looked at all the memory-leak-detection tools and also favour BoundsChecker. However, we didnt buy it yet since I dont have time to use it anyway. For at least 6 month now I only did things that I had to do until a certain date and fixing leaks doesnt have a date. I always said, we will buy it when I know I have at least two weeks, so that I can learn and use it. But, if I had two weeks now, I would rather take some holidays, I had almost none the last half year. Maybe now is the moment to buy BoundsChecker. But I read an example in the MSVC docs ("example 2", this is in the text about _CrtSetDumpClient) that I hoped would solve my problem quickly. However, it simply doesnt work :-(. Its one of those things were succeess always seems tantalizing (correct word?) near: When I saw example 2, I thought: That solves my main problem. When it didnt work, I thought I could use the ideas. When I saw that PPE as non-MFC-app makes additional problem, I thought, oh I have the MFC-source, I just need to transfer it. When it worked for ppe.cxx, I thought, oh its just a matter of cleaning it up and using the same principle for the other files. But it doenst work on some other files :-((. For example, in ppe.cxx: PPE_MainGroup = new AppPluginBase(0,0,0,0); works. In ppeScene clipboard = new ssgRoot () ; doesnt work. I think it has somehow to doe with the empty parentheses. In the header I include in everything, there are the lines, adapted from the MFC-source code: extern void* /*__cdecl */operator new(size_t nSize, char * lpszFileName, int nLine); #define new DEBUG_NEW #define DEBUG_NEW new(__FILE__, __LINE__) Probably the last two line could be merged. The error in ppeScene is "new doesnt accept three parameters". Sigh. Well, I have to look for info on overloading "new", the online-help is very sparse about this topic an my C++-books are in the company. BTW, since I want to use this code only to look for mem leaks, portability etc is not an issue. Bye bye, Wolfram. |