Skip to content

Commit 2d2a9e3

Browse files
Fixed bug with assert failure when JSON dump is created while a custom pool exist with specified string name
1 parent 5b598e0 commit 2d2a9e3

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

include/vk_mem_alloc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16006,8 +16006,8 @@ void VmaAllocator_T::PrintDetailedMap(VmaJsonWriter& json)
1600616006
json.ContinueString_Size(index++);
1600716007
if (pool->GetName())
1600816008
{
16009-
json.WriteString(" - ");
16010-
json.WriteString(pool->GetName());
16009+
json.ContinueString(" - ");
16010+
json.ContinueString(pool->GetName());
1601116011
}
1601216012
json.EndString();
1601316013

src/Tests.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5175,6 +5175,11 @@ static void TestPool_SameSize()
51755175
vmaGetPoolName(g_hAllocator, pool, &fetchedPoolName);
51765176
TEST(strcmp(fetchedPoolName, POOL_NAME) == 0);
51775177

5178+
// Generate JSON dump. There was a bug with this...
5179+
char* json = nullptr;
5180+
vmaBuildStatsString(g_hAllocator, &json, VK_TRUE);
5181+
vmaFreeStatsString(g_hAllocator, json);
5182+
51785183
vmaSetPoolName(g_hAllocator, pool, nullptr);
51795184
}
51805185

0 commit comments

Comments
 (0)