| 536 | } |
| 537 | |
| 538 | void LuaScript::Destroy() |
| 539 | { |
| 540 | // Assume the script object is clean if there's no Lua state |
| 541 | if (!L) return; |
| 542 | |
| 543 | // loops backwards because commands remove themselves from macros when |
| 544 | // they're unregistered |
| 545 | for (int i = macros.size() - 1; i >= 0; --i) |
| 546 | cmd::unreg(macros[i]->name()); |
| 547 | |
| 548 | filters.clear(); |
| 549 | |
| 550 | lua_close(L); |
| 551 | L = nullptr; |
| 552 | } |
| 553 | |
| 554 | std::vector<ExportFilter*> LuaScript::GetFilters() const |
| 555 | { |