Skip to content

Commit

Permalink
Delete dest buffer when move assignment called
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexMax committed Dec 21, 2023
1 parent 45c9e10 commit e7aa4bd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/lexio/bufreader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ class GenericBufReader

GenericBufReader &operator=(GenericBufReader &&other) noexcept
{
::delete[] m_buffer;

m_wrapped = std::move(other.m_wrapped);
m_buffer = other.m_buffer;
m_allocSize = other.m_allocSize;
Expand Down

0 comments on commit e7aa4bd

Please sign in to comment.