Skip to content

Commit

Permalink
Merge pull request #8 from SlateyDev/patch-2
Browse files Browse the repository at this point in the history
Bug fix: stop leaking memory for allocated data
  • Loading branch information
gamedolphin authored Aug 5, 2024
2 parents a33a342 + 1b22bc5 commit 7a90cdc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ bgfx::ShaderHandle loadShader(const char* _name) {
file.close();
}
const bgfx::Memory* mem = bgfx::copy(data,fileSize+1);
delete [] data;
mem->data[mem->size-1] = '\0';
bgfx::ShaderHandle handle = bgfx::createShader(mem);
bgfx::setName(handle, _name);
Expand Down

0 comments on commit 7a90cdc

Please sign in to comment.