On Wed, Jul 25, 2012 at 12:06 AM, Stuart Morgan
<
stuart...@chromium.org> wrote:
> We would need to add a new hook for the cases where a singleton needs
> to, say, persist some state to disk; this would be called at shutdown
> for desktop, and suspend time on mobile. Unlike AtExit it wouldn’t
> tear anything down, so it could be used the same way on both desktop
> and mobile.
Since I haven't seen this point argued - if anyone is using the
singleton destructor to do things like this at shutdown, they are
doing it wrong in just about the worst possible way that they could be
doing it wrong. If you can't figure out how to hook shutdown
correctly (*), you definitely aren't going to be able to hook
destructor ordering correctly.
-scott
(*) I'm not saying it's easy, I certainly do not know how to hook
shutdown correctly.