From 096a04201c2bf168f0a77e1094917628e8d51b05 Mon Sep 17 00:00:00 2001 From: Ken Van Hoeylandt Date: Fri, 6 Feb 2026 15:03:42 +0100 Subject: [PATCH] Fix for potential lock during destruct --- TactilityKernel/Source/driver.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/TactilityKernel/Source/driver.cpp b/TactilityKernel/Source/driver.cpp index a8ed0d11..f6df3afe 100644 --- a/TactilityKernel/Source/driver.cpp +++ b/TactilityKernel/Source/driver.cpp @@ -71,9 +71,10 @@ error_t driver_destruct(Driver* driver) { } get_driver_internal(driver)->destroying = true; - driver_unlock(driver); - delete get_driver_internal(driver); + DriverInternal* internal = get_driver_internal(driver); driver->internal = nullptr; + mutex_unlock(&internal->mutex); + delete internal; return ERROR_NONE; }