Skip to content

Commit

Permalink
Fixed memory leak in STBTextureLoader (forgot to call stbi_image_free)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ohmnivore committed Sep 20, 2018
1 parent 0093139 commit 236fc32
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions code/STBTextureLoader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ STBTextureLoader::Continue() {
// silently fail and return ResourceState::InvalidState
// (the same for failedAsync)
result = Gfx::resource()->initAsync(this->resId, texSetup, imgData, size);

// Free data!
stbi_image_free(imgData);
}
else {
result = Gfx::resource()->failedAsync(this->resId);
Expand Down

0 comments on commit 236fc32

Please sign in to comment.