Continuing on the thread about the threadmon singleton:
In addition, there is no good place to put the delete. You have to play games with atexit and then deal with the possibily of resurrection (singleton access after it's been deleted.)
Can we not just use a static instance of a small deleter class whose destructor frees the singleton? (Note that I'm not suggesting that we use the static instance to also _create_ the singleton, nor to be the singleton itself - as already discussed, that's insufficient as there's no general way to specify initialization order so using call_once remains the best option there IMHO - but we _can_, I believe, fix the problem that's causing Visual C++ programs to spew out memory leak errors every time we run them.) -- Will Bryant http://carcino.gen.nz/ will@core-dev.co.nz +64 21 655 443