fix more tingz

This commit is contained in:
2026-02-16 18:50:02 -05:00
parent 78a4ea7a0c
commit a6bf357228
2 changed files with 9 additions and 5 deletions

View File

@@ -193,10 +193,14 @@ remove_table_lock :: proc(engine: ^Storage_Engine, table_name: string) {
sync.mutex_lock(&engine.table_locks_mutex)
defer sync.mutex_unlock(&engine.table_locks_mutex)
if lock, found := engine.table_locks[table_name]; found {
delete(table_name, engine.allocator)
free(lock, engine.allocator)
delete_key(&engine.table_locks, table_name)
// Find the actual heap-allocated key string from the map
for key, lock in engine.table_locks {
if key == table_name {
delete_key(&engine.table_locks, key)
delete(key, engine.allocator) // free the map's owned key!
free(lock, engine.allocator)
break
}
}
}