mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-07-04 16:42:14 +02:00
fs.mitm: Turn RomFSSourceInfo::Cleanup into a destructor
This obsoletes the need for a custom deleter in other places
This commit is contained in:
parent
bb890efc40
commit
4d2096d685
@ -9,12 +9,7 @@
|
||||
LayeredRomFS::LayeredRomFS(std::shared_ptr<RomInterfaceStorage> s_r, std::shared_ptr<RomFileStorage> f_r, u64 tid) : storage_romfs(s_r), file_romfs(f_r), title_id(tid) {
|
||||
/* Start building the new virtual romfs. */
|
||||
RomFSBuildContext build_ctx(this->title_id);
|
||||
this->p_source_infos = std::shared_ptr<std::vector<RomFSSourceInfo>>(new std::vector<RomFSSourceInfo>(), [](std::vector<RomFSSourceInfo> *to_delete) {
|
||||
for (unsigned int i = 0; i < to_delete->size(); i++) {
|
||||
(*to_delete)[i].Cleanup();
|
||||
}
|
||||
delete to_delete;
|
||||
});
|
||||
this->p_source_infos = std::make_shared<std::vector<RomFSSourceInfo>>();
|
||||
if (Utils::IsSdInitialized()) {
|
||||
build_ctx.MergeSdFiles();
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ public:
|
||||
RomFSSourceInfo(u64 v_o, u64 s, const void *arg, RomFSDataSource t) : virtual_offset(v_o), size(s), info(MakeInfoVariantFromPointer(arg, t)) {
|
||||
}
|
||||
|
||||
void Cleanup() {
|
||||
~RomFSSourceInfo() {
|
||||
std::visit(InfoCleanupHelper{}, info);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user