File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ std::shared_ptr<PackFileData> PackFile::FindData(const String& filepath)
70
70
bodyDataSizeCompressed);
71
71
CC_ASSERT (result == Z_OK, " Decompression failed for filepath: " + filepath);
72
72
73
- return std::shared_ptr<PackFileData>( packFileData) ;
73
+ return { packFileData, free} ;
74
74
}
75
75
76
76
const std::map<String, PackFile::TocEntry*>& PackFile::GetEntries ()
Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ int main(int argc, char* argv[])
145
145
static_cast <float >(bodyDataSizeUncompressed) * 100 .f )),
146
146
writeTotal)
147
147
}
148
- free (bodyDataBufferCompressed);
148
+ if (bodyDataBufferCompressed) free (bodyDataBufferCompressed);
149
149
150
150
outputFileStream.write (PACKER_MAGIC_NUMBER_TOC, PACKER_MAGIC_NUMBER_SIZE);
151
151
writeTotal += PACKER_MAGIC_NUMBER_SIZE;
You can’t perform that action at this time.
0 commit comments