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 /indexer/classificator_loader.cpp | |
parent | 78fb143a7901288395d5cc70b0aa4e0b9ff707fc (diff) |
Platform::GetReader returns unique_ptr. Fix leaks.
Diffstat (limited to 'indexer/classificator_loader.cpp')
-rw-r--r-- | indexer/classificator_loader.cpp | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/indexer/classificator_loader.cpp b/indexer/classificator_loader.cpp index 6387be4d00..54acb5930d 100644 --- a/indexer/classificator_loader.cpp +++ b/indexer/classificator_loader.cpp @@ -14,29 +14,29 @@ namespace { - void ReadCommon(Reader * classificator, - Reader * types) - { - Classificator & c = classif(); - c.Clear(); +void ReadCommon(unique_ptr<Reader> classificator, + unique_ptr<Reader> types) +{ + Classificator & c = classif(); + c.Clear(); - { - //LOG(LINFO, ("Reading classificator")); - ReaderStreamBuf buffer(classificator); + { + //LOG(LINFO, ("Reading classificator")); + ReaderStreamBuf buffer(move(classificator)); - istream s(&buffer); - c.ReadClassificator(s); - } + istream s(&buffer); + c.ReadClassificator(s); + } - { - //LOG(LINFO, ("Reading types mapping")); - ReaderStreamBuf buffer(types); + { + //LOG(LINFO, ("Reading types mapping")); + ReaderStreamBuf buffer(move(types)); - istream s(&buffer); - c.ReadTypesMapping(s); - } + istream s(&buffer); + c.ReadTypesMapping(s); } } +} namespace classificator { @@ -55,7 +55,6 @@ namespace classificator if (mapStyle != MapStyleMerged || originMapStyle == MapStyleMerged) { GetStyleReader().SetCurrentStyle(mapStyle); - ReadCommon(p.GetReader("classificator.txt"), p.GetReader("types.txt")); |