diff options
author | Sven Gothel <[email protected]> | 2022-08-28 05:04:21 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2022-08-28 05:04:21 +0200 |
commit | 43c22914119306e11d4f7d9add5f0db40c9f0195 (patch) | |
tree | 6334120e3e848e350b89470ef90e06b010a212ca /src | |
parent | 99d8b47338d5b27f2e1216248bcb69df5ecfacb1 (diff) |
ByteInStream_{URL,Feed}::close(): Use ringbuffer::close()
Diffstat (limited to 'src')
-rw-r--r-- | src/byte_stream.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/byte_stream.cpp b/src/byte_stream.cpp index 6a81ace..a4bf25e 100644 --- a/src/byte_stream.cpp +++ b/src/byte_stream.cpp @@ -355,13 +355,12 @@ void ByteInStream_URL::close() noexcept { m_result = async_io_result_t::SUCCESS; // signal end of streaming } - m_buffer.drop(m_buffer.size()); // unblock putBlocking(..) + m_buffer.close( true /* zeromem */); // also unblocks all r/w ops if( nullptr != m_url_thread && m_url_thread->joinable() ) { DBG_PRINT("ByteInStream_URL: close.1 %s, %s", id().c_str(), m_buffer.toString().c_str()); m_url_thread->join(); } m_url_thread = nullptr; - m_buffer.clear( true /* zeromem */); DBG_PRINT("ByteInStream_URL: close.X %s, %s", id().c_str(), to_string_int().c_str()); } @@ -453,9 +452,7 @@ void ByteInStream_Feed::close() noexcept { if( async_io_result_t::NONE == m_result ) { m_result = async_io_result_t::SUCCESS; // signal end of streaming } - m_buffer.drop(m_buffer.size()); // unblock putBlocking(..) - - m_buffer.clear( true /* zeromem */); + m_buffer.close( true /* zeromem */); // also unblocks all r/w ops DBG_PRINT("ByteInStream_Feed: close.X %s, %s", id().c_str(), to_string_int().c_str()); } |