| 677 | } |
| 678 | |
| 679 | void stopAllFunc() |
| 680 | { |
| 681 | if (s_engine) |
| 682 | { |
| 683 | const s32 count = (s32)s_scriptThreads.size(); |
| 684 | ScriptThread* thread = s_scriptThreads.data(); |
| 685 | |
| 686 | for (s32 i = 0; i < count; i++) |
| 687 | { |
| 688 | if (thread[i].asContext == nullptr) { continue; } |
| 689 | |
| 690 | asIScriptContext* context = thread[i].asContext; |
| 691 | context->Abort(); |
| 692 | s_engine->ReturnContext(context); |
| 693 | } |
| 694 | } |
| 695 | // Take this opportunity to defrag. |
| 696 | s_scriptThreads.clear(); |
| 697 | s_freeThreads.clear(); |
| 698 | } |
| 699 | |
| 700 | void* getEngine() |
| 701 | { |