Skip to content

Commit

Permalink
_GetCachedImage: fix leak (fix #124)
Browse files Browse the repository at this point in the history
  • Loading branch information
pthom committed Sep 18, 2024
1 parent 95531ca commit 2dedc94
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/hello_imgui/internal/image_from_asset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,11 @@ namespace HelloImGui
&concreteImage->Width, &concreteImage->Height, NULL, 4);
if (image_data_rgba == NULL)
{
IM_ASSERT(false && "ImageDx11: Failed to load image!");
throw std::runtime_error("ImageAbstract: Failed to load image!");
IM_ASSERT(false && "_GetCachedImage: Failed to load image!");
throw std::runtime_error("_GetCachedImage: Failed to load image!");
}

FreeAssetFileData(&assetData);
stbi_image_free(image_data_rgba);
concreteImage->_impl_StoreTexture(concreteImage->Width, concreteImage->Height, image_data_rgba);
}

Expand Down

0 comments on commit 2dedc94

Please sign in to comment.