diff options
author | pauldubois <pauldubois@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-03-09 21:49:20 +0000 |
---|---|---|
committer | pauldubois <pauldubois@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-03-09 21:49:20 +0000 |
commit | 736d54113b3f4923892fd0060600e619dd29d9db (patch) | |
tree | d417427d8aafeab5621c0bdfc9f732e60b1749ac /crawl-ref/source/acr.cc | |
parent | 5e2d8f305c41e9f2eec9b5a66804d1a03370a0b5 (diff) | |
download | crawl-ref-736d54113b3f4923892fd0060600e619dd29d9db.tar.gz crawl-ref-736d54113b3f4923892fd0060600e619dd29d9db.zip |
Fix crash on shutdown caused by bad order of static destruction (ugh).
crawl_environment's destructor uses dlua, but dlua was getting destroyed
first. Rather than mess with stupidly complicated singleton patterns,
I've moved the definition of clua and dlua into acr.cc, to just before
crawl_environment. This makes the order of construction/destruction
well-defined and should be a workable long-term solution.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3559 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/acr.cc')
-rw-r--r-- | crawl-ref/source/acr.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index c7581c92d1..1e3a6c7bff 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -140,11 +140,19 @@ #include "tiles.h" -crawl_environment env; +// ---------------------------------------------------------------------- +// Globals whose construction/destruction order needs to be managed +// ---------------------------------------------------------------------- + +CLua clua(true); +CLua dlua(false); // Lua interpreter for the dungeon builder. +crawl_environment env; // Requires dlua player you; system_environment SysEnv; game_state crawl_state; + + std::string init_file_location; // externed in newgame.cc char info[ INFO_SIZE ]; // messaging queue extern'd everywhere {dlb} |