mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-09-05 09:05:54 +00: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:
parent
a0ac2b8673
commit
edbbf493f8
22 changed files with 204 additions and 231 deletions
|
@ -14,6 +14,7 @@
|
|||
// detect whether the file is a compressed blob, or just a big hunk of data, or a drive, and
|
||||
// automatically do the right thing.
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include "Common/CommonTypes.h"
|
||||
|
||||
|
@ -75,7 +76,7 @@ private:
|
|||
};
|
||||
|
||||
// Factory function - examines the path to choose the right type of IBlobReader, and returns one.
|
||||
IBlobReader* CreateBlobReader(const std::string& filename);
|
||||
std::unique_ptr<IBlobReader> CreateBlobReader(const std::string& filename);
|
||||
|
||||
typedef bool (*CompressCB)(const std::string& text, float percent, void* arg);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue