From 8567d9a5737e8b358128d71818a77139be80969d Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sat, 30 Aug 2014 09:18:52 -0700 Subject: [PATCH] Use more make_unqiue --- libaegisub/common/thesaurus.cpp | 2 +- src/ass_parser.cpp | 2 +- src/audio_player_oss.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libaegisub/common/thesaurus.cpp b/libaegisub/common/thesaurus.cpp index 41cd7085f..36212dfbe 100644 --- a/libaegisub/common/thesaurus.cpp +++ b/libaegisub/common/thesaurus.cpp @@ -39,7 +39,7 @@ Thesaurus::Thesaurus(agi::fs::path const& dat_path, agi::fs::path const& idx_pat std::string unused_entry_count; getline(idx, unused_entry_count); - conv.reset(new charset::IconvWrapper(encoding_name.c_str(), "utf-8")); + conv = make_unique(encoding_name.c_str(), "utf-8"); // Read the list of words and file offsets for those words for (auto const& line : line_iterator(idx, encoding_name)) { diff --git a/src/ass_parser.cpp b/src/ass_parser.cpp index 8ba47d0d4..b2710cceb 100644 --- a/src/ass_parser.cpp +++ b/src/ass_parser.cpp @@ -95,7 +95,7 @@ public: }; AssParser::AssParser(AssFile *target, int version) -: property_handler(new HeaderToProperty) +: property_handler(agi::make_unique()) , target(target) , version(version) , state(&AssParser::ParseScriptInfoLine) diff --git a/src/audio_player_oss.cpp b/src/audio_player_oss.cpp index fb52b87fc..93950baef 100644 --- a/src/audio_player_oss.cpp +++ b/src/audio_player_oss.cpp @@ -63,7 +63,7 @@ class OSSPlayer final : public AudioPlayer { unsigned int rate = 0; /// Worker thread that does the actual writing - OSSPlayerThread *thread = nullptr; + std::unique_ptr thread; /// Is the player currently playing? volatile bool playing = false; @@ -198,7 +198,7 @@ void OSSPlayer::Play(int64_t start, int64_t count) start_frame = cur_frame = start; end_frame = start + count; - thread = new OSSPlayerThread(this); + thread = agi::make_unique(this); thread->Create(); thread->Run(); @@ -215,7 +215,7 @@ void OSSPlayer::Stop() thread->Delete(); } thread->Wait(); - delete thread; + thread.reset(); } // errors can be ignored here