mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
DiscIO: Make factory methods return unique_ptrs
Rather than rely on the developer to do the right thing, just make the default behavior safely deallocate resources. If shared semantics are ever needed in the future, the constructor that takes a unique_ptr for shared_ptr can be used.
This commit is contained in:
@ -4,6 +4,7 @@
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstring>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "Common/CDUtils.h"
|
||||
@ -114,7 +115,7 @@ bool SectorReader::ReadMultipleAlignedBlocks(u64 block_num, u64 num_blocks, u8 *
|
||||
return true;
|
||||
}
|
||||
|
||||
IBlobReader* CreateBlobReader(const std::string& filename)
|
||||
std::unique_ptr<IBlobReader> CreateBlobReader(const std::string& filename)
|
||||
{
|
||||
if (cdio_is_cdrom(filename))
|
||||
return DriveReader::Create(filename);
|
||||
|
Reference in New Issue
Block a user