Josh Posted April 3, 2023 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 Let's build cool stuff and have fun.
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.