Hello Malte, > I like leak detection, but I think inheritance is not so useful here, > because you can't simply add leak detection to a class 'on demand', > without compiling all following modules.
There is no need to recompile derived classes/modules, because the LeakGuard-ed class references only static data and has no vtable. Nevertheless, IMO leak detection has to be thoroughly considered during programming, same as you add OSL_ASSERTs to your code, so there ought to be little need for on-demand leak detection. > We already have some leak detection in tools/debug.hxx: > DBG_CTOR and DBG_DTOR. > Together with DBG_CHECKTHIS, you can also use it to check if your object > is still valid. > > Advantage: No inheritance > (Small) Disadvantage: Manually put DBG_CTOR/DTOR in all ctors and dtors. > I really don't like macros, and IMO it is much more elegant to just inherit the LeakGuard feature without thinking about constructors and destructors. > So maybe you would like to extend the things we already have in tools... This would not solve the need for lower level modules, e.g. UDK modules. regards, -Daniel --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]