| 638 | } |
| 639 | |
| 640 | void VM::unsafeCleanup() { |
| 641 | if (Mod) { |
| 642 | Mod.reset(); |
| 643 | } |
| 644 | if (Comp) { |
| 645 | Comp.reset(); |
| 646 | } |
| 647 | if (ActiveModInst) { |
| 648 | ActiveModInst.reset(); |
| 649 | } |
| 650 | if (ActiveCompInst) { |
| 651 | ActiveCompInst.reset(); |
| 652 | } |
| 653 | StoreRef.reset(); |
| 654 | RegModInsts.clear(); |
| 655 | Stat.clear(); |
| 656 | unsafeLoadBuiltInHosts(); |
| 657 | unsafeLoadPlugInHosts(); |
| 658 | unsafeRegisterBuiltInHosts(); |
| 659 | unsafeRegisterPlugInHosts(); |
| 660 | LoaderEngine.reset(); |
| 661 | Stage = VMStage::Inited; |
| 662 | } |
| 663 | |
| 664 | std::vector<std::pair<std::string, const AST::FunctionType &>> |
| 665 | VM::unsafeGetFunctionList() const { |