From edbbf493f807ed94b9b32cfb7463f9b7f8f27852 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 6 Dec 2015 23:15:51 -0500 Subject: 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. --- Source/Core/DiscIO/Blob.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Source/Core/DiscIO/Blob.cpp') diff --git a/Source/Core/DiscIO/Blob.cpp b/Source/Core/DiscIO/Blob.cpp index 1a2333f198..3d0ee64a39 100644 --- a/Source/Core/DiscIO/Blob.cpp +++ b/Source/Core/DiscIO/Blob.cpp @@ -4,6 +4,7 @@ #include #include +#include #include #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 CreateBlobReader(const std::string& filename) { if (cdio_is_cdrom(filename)) return DriveReader::Create(filename); -- cgit v1.2.3