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:
Lioncash
2015-12-06 23:15:51 -05:00
parent a0ac2b8673
commit edbbf493f8
22 changed files with 204 additions and 231 deletions

View File

@ -4,6 +4,7 @@
#pragma once
#include <memory>
#include <string>
#include "Common/CommonTypes.h"
@ -21,7 +22,7 @@ namespace DiscIO
class DriveReader : public SectorReader
{
public:
static DriveReader* Create(const std::string& drive);
static std::unique_ptr<DriveReader> Create(const std::string& drive);
~DriveReader();
BlobType GetBlobType() const override { return BlobType::DRIVE; }
u64 GetDataSize() const override { return m_size; }