Skip to content

Commit

Permalink
Shutdown lua before cleaning up rocket contexts
Browse files Browse the repository at this point in the history
Otherwise Lua will try to use already cleaned up resources.
  • Loading branch information
DolceTriade committed Nov 2, 2015
1 parent 8012e3e commit 79fc559
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cgame/rocket/rocket.cpp
Expand Up @@ -395,6 +395,9 @@ void Rocket_Shutdown()
extern std::map<std::string, RocketDataGrid*> dataSourceMap;
extern std::queue< RocketEvent_t* > eventQueue;

// Shut down Lua before we clean up contexts
Rocket::Core::Lua::Interpreter::Shutdown();

if ( menuContext )
{
menuContext->RemoveReference();
Expand All @@ -407,7 +410,6 @@ void Rocket_Shutdown()
hudContext = nullptr;
}

Rocket::Core::Lua::Interpreter::Shutdown();
Rocket::Core::Shutdown();

// Prevent memory leaks
Expand Down

0 comments on commit 79fc559

Please sign in to comment.