diff options
| author | Markus Wick <degasus@users.noreply.github.com> | 2015-12-07 19:12:15 +0100 |
|---|---|---|
| committer | Markus Wick <degasus@users.noreply.github.com> | 2015-12-07 19:12:15 +0100 |
| commit | 9719804cd2f61adf2ab7f0dfc15efda36c5df529 (patch) | |
| tree | 7c368eff997e8db51cc6af795bf30ccf34f8ae7e /Source/Core/DiscIO/DriveBlob.cpp | |
| parent | 31a40447d8e9d8e4d29aa58d02df20e957d8d24b (diff) | |
| parent | edbbf493f807ed94b9b32cfb7463f9b7f8f27852 (diff) | |
Merge pull request #3320 from lioncash/factory
DiscIO: Make factory methods return unique_ptrs
Diffstat (limited to 'Source/Core/DiscIO/DriveBlob.cpp')
| -rw-r--r-- | Source/Core/DiscIO/DriveBlob.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Source/Core/DiscIO/DriveBlob.cpp b/Source/Core/DiscIO/DriveBlob.cpp index 07105a9170..efd78db82e 100644 --- a/Source/Core/DiscIO/DriveBlob.cpp +++ b/Source/Core/DiscIO/DriveBlob.cpp @@ -4,6 +4,7 @@ #include <cstdio> #include <cstring> +#include <memory> #include <string> #include "Common/CommonTypes.h" @@ -84,15 +85,12 @@ DriveReader::~DriveReader() #endif } -DriveReader* DriveReader::Create(const std::string& drive) +std::unique_ptr<DriveReader> DriveReader::Create(const std::string& drive) { - DriveReader* reader = new DriveReader(drive); + auto reader = std::unique_ptr<DriveReader>(new DriveReader(drive)); if (!reader->IsOK()) - { - delete reader; - return nullptr; - } + reader.reset(); return reader; } |
