fix(util/script_state_manager): crash when compiling with msys2 stack

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2014-09-17 08:39:06 -07:00
parent aa5abefaff
commit a72a11db8e

View file

@ -22,8 +22,10 @@ struct script_state_manager {
};
static script_state_manager & get_manager() {
static script_state_manager g_manager;
return g_manager;
static std::unique_ptr<script_state_manager> g_manager;
if (!g_manager.get())
g_manager.reset(new script_state_manager());
return *g_manager;
}
static script_state_manager & g_aux = get_manager(); // force manager to be initialized at startup