From 4d2096d685aee73ad8327f27d910d816a4a9fb74 Mon Sep 17 00:00:00 2001 From: Tony Wasserka Date: Sat, 16 Jun 2018 16:50:12 +0200 Subject: [PATCH] fs.mitm: Turn RomFSSourceInfo::Cleanup into a destructor This obsoletes the need for a custom deleter in other places --- stratosphere/fs_mitm/source/fsmitm_layeredrom.cpp | 7 +------ stratosphere/fs_mitm/source/fsmitm_romfsbuild.hpp | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/stratosphere/fs_mitm/source/fsmitm_layeredrom.cpp b/stratosphere/fs_mitm/source/fsmitm_layeredrom.cpp index f1e926b7d..819029f53 100644 --- a/stratosphere/fs_mitm/source/fsmitm_layeredrom.cpp +++ b/stratosphere/fs_mitm/source/fsmitm_layeredrom.cpp @@ -9,12 +9,7 @@ LayeredRomFS::LayeredRomFS(std::shared_ptr s_r, std::shared_ptr 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>(new std::vector(), [](std::vector *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>(); if (Utils::IsSdInitialized()) { build_ctx.MergeSdFiles(); } diff --git a/stratosphere/fs_mitm/source/fsmitm_romfsbuild.hpp b/stratosphere/fs_mitm/source/fsmitm_romfsbuild.hpp index d8de39007..473880306 100644 --- a/stratosphere/fs_mitm/source/fsmitm_romfsbuild.hpp +++ b/stratosphere/fs_mitm/source/fsmitm_romfsbuild.hpp @@ -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); }