| 85 | } |
| 86 | |
| 87 | void LuaMimoTransform::rebuildInstance() { |
| 88 | has_session_start_ = false; |
| 89 | instance_.reset(); |
| 90 | error_.clear(); |
| 91 | if (!engine_) { |
| 92 | error_ = "no script engine"; |
| 93 | return; |
| 94 | } |
| 95 | auto made = engine_->createInstance(klass_, params_json_); |
| 96 | if (!made.has_value()) { |
| 97 | error_ = made.error(); |
| 98 | return; |
| 99 | } |
| 100 | instance_ = std::move(made).value(); |
| 101 | } |
| 102 | |
| 103 | void LuaMimoTransform::reset() { |
| 104 | // Construct-new-and-swap: a fresh VM/instance is the only guaranteed-clean reset |
nothing calls this directly
no test coverage detected