Re: bonobo-activation; freeing base services ...



Maciej Stachowiak <mjs noisehavoc org> writes: 
> Another possibility is that if the warnings are purely advisory but do
> not come up on abnormal program termination, it does not seem so bad
> to install an atexit handler which would be called only on normal
> termination to avoid them. (Havoc, what would you think of that?)

What I'm arguing is:

 - atexit() handlers have X amount of inherent badness, especially 
   in a library
 - ergo not worth it for debugging code that doesn't matter if 
   it runs
 - very dangerously broken if it's anything important, because it
   won't run on abnormal termination [1]
 - ergo atexit() handlers are either not worth it or very dangerously 
   broken
 - with the possible exception of your gnome-vfs example because 
   abnormal termination is handled by the kernel, and normal 
   is not

Why not install the debug atexit() handlers and print the warnings if
getenv(ORBIT_DEBUG_OBJECT_LEAKS) != NULL, and install no warnings and
no handlers if that env variable is unset.

Havoc

 [1] this is true even if you have backup code for the abnormal case,
   because if that code works reliably it can just be the main code,
   and if it doesn't you still don't handle abnormal termination
   adequately. abnormal != uncommon.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]