mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-25 07:09:48 -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:
@ -14,6 +14,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
@ -46,7 +47,7 @@ struct CompressedBlobHeader // 32 bytes
|
||||
class CompressedBlobReader : public SectorReader
|
||||
{
|
||||
public:
|
||||
static CompressedBlobReader* Create(const std::string& filename);
|
||||
static std::unique_ptr<CompressedBlobReader> Create(const std::string& filename);
|
||||
~CompressedBlobReader();
|
||||
const CompressedBlobHeader &GetHeader() const { return m_header; }
|
||||
BlobType GetBlobType() const override { return BlobType::GCZ; }
|
||||
|
Reference in New Issue
Block a user