]> git.sesse.net Git - stockfish/commitdiff
Do not call exit_threads() in Application d'tor
authorMarco Costalba <mcostalba@gmail.com>
Sun, 25 Apr 2010 09:31:48 +0000 (10:31 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 25 Apr 2010 09:35:55 +0000 (10:35 +0100)
Because exit_threads() references the global object TM, we
need to call the function when still inside main(), otherwise,
due to undefined global object initialization and destruction
we could end up with referencing an already destroyed object.

Actually this should not happen because Application singleton
is initialized _only_ after all the other globals due to how
Application::initialize() is defined, but this is very tricky
C++ and not easy to follow, even for me ;-)

Also rearranged a bit main() code flow.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>

No differences found