From f7cb946830def9690cf626331529699262c06310 Mon Sep 17 00:00:00 2001 From: Theis Pieter Hollebeek Date: Mon, 16 Dec 2024 10:05:20 +0100 Subject: [PATCH] kill running thread on restart --- runtime/vm_provider.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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,