summaryrefslogtreecommitdiff
path: root/core/fxcrt/cfx_memorystream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt/cfx_memorystream.cpp')
-rw-r--r--core/fxcrt/cfx_memorystream.cpp22
1 files changed, 6 insertions, 16 deletions
diff --git a/core/fxcrt/cfx_memorystream.cpp b/core/fxcrt/cfx_memorystream.cpp
index 15cde78f42..b0a0bd91d1 100644
--- a/core/fxcrt/cfx_memorystream.cpp
+++ b/core/fxcrt/cfx_memorystream.cpp
@@ -17,26 +17,16 @@ constexpr size_t kBlockSize = 64 * 1024;
} // namespace
CFX_MemoryStream::CFX_MemoryStream(bool bConsecutive)
- : m_nTotalSize(0),
- m_nCurSize(0),
- m_bConsecutive(bConsecutive),
- m_bTakeOver(true) {}
-
-CFX_MemoryStream::CFX_MemoryStream(uint8_t* pBuffer,
- size_t nSize,
- bool bTakeOver)
- : m_nTotalSize(nSize),
- m_nCurSize(nSize),
- m_bConsecutive(true),
- m_bTakeOver(bTakeOver) {
+ : m_nTotalSize(0), m_nCurSize(0), m_bConsecutive(bConsecutive) {}
+
+CFX_MemoryStream::CFX_MemoryStream(uint8_t* pBuffer, size_t nSize)
+ : m_nTotalSize(nSize), m_nCurSize(nSize), m_bConsecutive(true) {
m_Blocks.push_back(pBuffer);
}
CFX_MemoryStream::~CFX_MemoryStream() {
- if (m_bTakeOver) {
- for (uint8_t* pBlock : m_Blocks)
- FX_Free(pBlock);
- }
+ for (uint8_t* pBlock : m_Blocks)
+ FX_Free(pBlock);
}
FX_FILESIZE CFX_MemoryStream::GetSize() {