From 08c598aea11749cd070d95921fbdfd94bc235163 Mon Sep 17 00:00:00 2001 From: ogam <14947455+ogam@users.noreply.github.com> Date: Mon, 22 Jul 2024 10:28:56 -0700 Subject: [PATCH] first set of handles allocated returns an uninitialized handle --- src/cute_handle_table.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cute_handle_table.cpp b/src/cute_handle_table.cpp index fb04960c1..e5ce29098 100644 --- a/src/cute_handle_table.cpp +++ b/src/cute_handle_table.cpp @@ -83,7 +83,7 @@ CF_Handle cf_handle_allocator_alloc(CF_HandleTable* table, uint32_t index, uint1 int first_index = table->m_handles.capacity(); if (!first_index) first_index = 1; table->m_handles.ensure_count(first_index * 2); - int last_index = table->m_handles.capacity() - 1; + int last_index = table->m_handles.count() - 1; s_add_elements_to_freelist(table, first_index, last_index); freelist_index = table->m_freelist; }