Prepare for dumping NPDRM isos, use shared_ptr to manage lifetime of BlockDevice

This commit is contained in:
Henrik Rydgård committed 2026-03-19 13:59:04 +01:00
1 parent 4c3d982182
commit 0e55129fab
11 files changed
+17 -16

No files matched your search

+2 -2
View File
@@ -68,7 +68,7 @@ bool MountGameISO(FileLoader *fileLoader, std::string *errorString) {
fileSystem = std::make_shared<VirtualDiscFileSystem>(&pspFileSystem, fileLoader->GetPath());
blockSystem = fileSystem;
} else {
auto bd = ConstructBlockDevice(fileLoader, errorString);
std::shared_ptr<BlockDevice> bd(ConstructBlockDevice(fileLoader, errorString));
if (!bd) {
// Can only fail if the ISO is bad.
return false;
@@ -302,7 +302,7 @@ static Path NormalizePath(const Path &path) {
bool Load_PSP_ELF_PBP(FileLoader *fileLoader, std::string_view discId, std::string *error_string) {
// This is really just for headless, might need tweaking later.
if (PSP_CoreParameter().mountIsoLoader != nullptr) {
auto bd = ConstructBlockDevice(PSP_CoreParameter().mountIsoLoader, error_string);
std::shared_ptr<BlockDevice> bd(ConstructBlockDevice(PSP_CoreParameter().mountIsoLoader, error_string));
if (bd) {
auto umd2 = std::make_shared<ISOFileSystem>(&pspFileSystem, bd);
auto blockSystem = std::make_shared<ISOBlockSystem>(umd2);