Skip to content

Commit

Permalink
avoid close threadlocal lua state for singleton and cudart safety (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
tqchen authored Sep 21, 2016
1 parent a92d7a3 commit d0e19e7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion include/dmlc/lua.h
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,10 @@ inline LuaState::LuaState() {
}

inline LuaState::~LuaState() {
lua_close(L_);
if (option_ != kThreadLocal && L_ != nullptr) {
// never close threadlocal, for save destruction.
lua_close(L_);
}
}

inline LuaState* LuaState::Create_(Option opt) {
Expand Down

0 comments on commit d0e19e7

Please sign in to comment.