kill running thread on restart

This commit is contained in:
Theis Pieter Hollebeek 2024-12-16 10:05:20 +01:00
parent e4f2452427
commit f7cb946830

View File

@ -9,6 +9,11 @@ auto VmProvider::load_and_start(std::vector<uint32_t> instructions) -> void
{ {
std::lock_guard lock(this->mutex); std::lock_guard lock(this->mutex);
if (this->running_thread) {
this->vm = {};
this->running_thread = {};
}
this->vm.emplace(instructions, this->vm.emplace(instructions,
VMOpts { VMOpts {
.flame_graph = true, .flame_graph = true,