From 00626b1633661c80646bacd2dcddf830330f4e6c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 31 Dec 2015 13:01:03 +0100 Subject: [PATCH] decoder/Thread: use std::unique_ptr --- src/decoder/DecoderThread.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/decoder/DecoderThread.cxx b/src/decoder/DecoderThread.cxx index 394ad5ecb..60ca1e01b 100644 --- a/src/decoder/DecoderThread.cxx +++ b/src/decoder/DecoderThread.cxx @@ -40,6 +40,7 @@ #include "Log.hxx" #include +#include static constexpr Domain decoder_thread_domain("decoder_thread"); @@ -276,7 +277,7 @@ decoder_run_stream(Decoder &decoder, const char *uri) { DecoderControl &dc = decoder.dc; - InputStream *input_stream = decoder_input_stream_open(dc, uri); + std::unique_ptr input_stream(decoder_input_stream_open(dc, uri)); if (input_stream == nullptr) return false; @@ -292,7 +293,6 @@ decoder_run_stream(Decoder &decoder, const char *uri) decoder_run_stream_fallback(decoder, *input_stream)); dc.Unlock(); - delete input_stream; return success; }