|
Boost Users : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-08-26 16:26:57
Elisha Berns wrote:
> Well, since I started this whole thing, I have to ask... If it's a
> singleton, doesn't it need to clean itself up? If the assumption is
> that the OS will clean it up when the process is killed, isn't that a
> bit shaky as far as sound assumptions go?
It's a perfectly sound assumption for today's OSes, even if you rely on them
to clean up kernel resources (such as a Win32 HANDLE) and not just memory.
Manually releasing everything with program lifetime duration just makes the
process exit more slowly (but it keeps simple leak detectors happy).
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.)
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net