Skip to content

Commit 439640a

Browse files
committed
fix free heap memory issues, deallocate ImGUI pixel blocks correctly
1 parent 2ccda4e commit 439640a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/nbl/ext/ImGui/ImGui.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,10 +393,9 @@ smart_refctd_ptr<IGPUImageView> UI::createFontAtlasTexture(const SCreationParame
393393

394394
// CCustomAllocatorCPUBuffer is kinda crap and doesn't support stateful allocators
395395
uint8_t* pixels = nullptr;
396-
auto freeMemory = core::makeRAIIExiter([&pixels]()->void
396+
auto freeMemory = core::makeRAIIExiter([&fontAtlas]()->void
397397
{
398-
if (pixels)
399-
IM_FREE(pixels);
398+
fontAtlas->ClearTexData(); // calls free on pixel blocks
400399
}
401400
);
402401

0 commit comments

Comments
 (0)