Josh Posted April 3, 2023 Share Posted April 3, 2023 Replace this code: void ZipFile::Save(ZipArchive::Ptr zipArchive, const std::string& zipPath) { ZipFile::SaveAndClose(zipArchive, zipPath); zipArchive = ZipFile::Open(zipPath); } With this: void ZipFile::Save(ZipArchive::Ptr& zipArchive, const std::string& zipPath) { ZipFile::SaveAndClose(zipArchive, zipPath); zipArchive = ZipFile::Open(zipPath); } The & makes is to the value of the shared pointer passed to the argument gets assigned to the new object. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.