diff --git a/runtime/vm_provider.cpp b/runtime/vm_provider.cpp index 8ddf4ff..51bf5cf 100644 --- a/runtime/vm_provider.cpp +++ b/runtime/vm_provider.cpp @@ -9,6 +9,11 @@ auto VmProvider::load_and_start(std::vector instructions) -> void { std::lock_guard lock(this->mutex); + if (this->running_thread) { + this->vm = {}; + this->running_thread = {}; + } + this->vm.emplace(instructions, VMOpts { .flame_graph = true,