Skip to content

Commit

Permalink
memory leak fix
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown321 committed Jan 10, 2025
1 parent 4509896 commit 9565f53
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cassette/cassette.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,10 @@ namespace Cassette {
void Cassette::Unload() {
childThreadsStop = true;

ActiveReel = nullptr;
ActiveTape = nullptr;
ActiveAtlas = nullptr;

for (auto &v : Tapes) {
v.second.Unload();
}
Expand Down
1 change: 1 addition & 0 deletions src/skinElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ struct FlatTexture {

textureID = LoadCompressedTexture(header.width, header.height, length - ETC_PKM_HEADER_SIZE, b);
s.close();
delete[] b;

if (textureID > 0) {
this->upscaled.width = header.width;
Expand Down
1 change: 1 addition & 0 deletions src/util/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ Atlas LoadAtlas(const std::string &texturePath, const std::string &coordsPath) {

auto tid = LoadCompressedTexture(header.width, header.height, length - ETC_PKM_HEADER_SIZE, b);
s.close();
delete[] b;

if (tid == 0) {
DLOG("texture upload failed\n");
Expand Down

0 comments on commit 9565f53

Please sign in to comment.