[UI] Free image data from stbi_load

This commit is contained in:
Adrian
2026-01-04 16:12:01 +00:00
committed by Radosław Gliński
parent b8b33ecabf
commit b723d6e7c2

View File

@@ -289,9 +289,13 @@ std::unique_ptr<ImmediateTexture> ImGuiDrawer::LoadImGuiIcon(
return {};
}
return immediate_drawer_->CreateTexture(
auto texture = immediate_drawer_->CreateTexture(
width, height, ImmediateTextureFilter::kLinear, true,
reinterpret_cast<uint8_t*>(image_data));
stbi_image_free(image_data);
return texture;
}
std::map<uint32_t, std::unique_ptr<ImmediateTexture>> ImGuiDrawer::LoadIcons(
@@ -328,6 +332,8 @@ void ImGuiDrawer::SetupNotificationTextures() {
notification_icon_textures_.push_back(immediate_drawer_->CreateTexture(
width, height, ImmediateTextureFilter::kLinear, true,
reinterpret_cast<uint8_t*>(image_data)));
stbi_image_free(image_data);
}
}
@@ -568,6 +574,8 @@ void ImGuiDrawer::SetImmediateDrawer(ImmediateDrawer* new_immediate_drawer) {
locked_achievement_icon_ = immediate_drawer_->CreateTexture(
width, height, ImmediateTextureFilter::kLinear, true,
reinterpret_cast<uint8_t*>(image_data));
stbi_image_free(image_data);
}
}