Skip to content

Commit 53b5ba6

Browse files
committed
Fix image meory leak
1 parent 5e6581d commit 53b5ba6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/widgets.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ static Image *loadIntoImageCache(Context &ctx, const char *filename) {
6666
int w, h, bytesPerPixel;
6767
unsigned char *data = stbi_load(filename, &w, &h, &bytesPerPixel, 0);
6868
if (data == nullptr) {
69+
delete image;
6970
return nullptr;
7071
}
7172

0 commit comments

Comments
 (0)