diff options
author | Sergey Magidovich <mgsergio@mapswithme.com> | 2016-02-28 22:33:38 +0300 |
---|---|---|
committer | Sergey Yershov <yershov@corp.mail.ru> | 2016-03-23 16:49:24 +0300 |
commit | 4a3989ff23d90c112b50f690e7a2c2329aa54389 (patch) | |
tree | 6c4476e3d423686acbf55f180c39abb55561b929 /coding/buffer_reader.hpp | |
parent | 78fb143a7901288395d5cc70b0aa4e0b9ff707fc (diff) |
Platform::GetReader returns unique_ptr. Fix leaks.
Diffstat (limited to 'coding/buffer_reader.hpp')
-rw-r--r-- | coding/buffer_reader.hpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/coding/buffer_reader.hpp b/coding/buffer_reader.hpp index 8c99d644d1..c35911a29a 100644 --- a/coding/buffer_reader.hpp +++ b/coding/buffer_reader.hpp @@ -40,9 +40,10 @@ public: return BufferReader(*this, pos, size); } - inline BufferReader * CreateSubReader(uint64_t pos, uint64_t size) const + inline unique_ptr<Reader> CreateSubReader(uint64_t pos, uint64_t size) const { - return new BufferReader(*this, pos, size); + // Can't use make_unique with private constructor. + return unique_ptr<Reader>(new BufferReader(*this, pos, size)); } private: |