File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ std::shared_ptr<PackFileData> PackFile::FindData(const String& filepath)
7070 bodyDataSizeCompressed);
7171 CC_ASSERT (result == Z_OK, " Decompression failed for filepath: " + filepath);
7272
73- return std::shared_ptr<PackFileData>( packFileData) ;
73+ return { packFileData, free} ;
7474}
7575
7676const 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[])
145145 static_cast <float >(bodyDataSizeUncompressed) * 100 .f )),
146146 writeTotal)
147147 }
148- free (bodyDataBufferCompressed);
148+ if (bodyDataBufferCompressed) free (bodyDataBufferCompressed);
149149
150150 outputFileStream.write (PACKER_MAGIC_NUMBER_TOC, PACKER_MAGIC_NUMBER_SIZE);
151151 writeTotal += PACKER_MAGIC_NUMBER_SIZE;
You can’t perform that action at this time.
0 commit comments