fix memory leak
parent
585429e345
commit
1d8f9b4bbd
|
@ -186,6 +186,7 @@ namespace blt
|
||||||
|
|
||||||
scoped_buffer(scoped_buffer&& move) noexcept
|
scoped_buffer(scoped_buffer&& move) noexcept
|
||||||
{
|
{
|
||||||
|
delete[] _buffer;
|
||||||
_buffer = move._buffer;
|
_buffer = move._buffer;
|
||||||
_size = move.size();
|
_size = move.size();
|
||||||
move._buffer = nullptr;
|
move._buffer = nullptr;
|
||||||
|
@ -195,6 +196,7 @@ namespace blt
|
||||||
|
|
||||||
scoped_buffer& operator=(scoped_buffer&& moveAssignment) noexcept
|
scoped_buffer& operator=(scoped_buffer&& moveAssignment) noexcept
|
||||||
{
|
{
|
||||||
|
delete[] _buffer;
|
||||||
_buffer = moveAssignment._buffer;
|
_buffer = moveAssignment._buffer;
|
||||||
_size = moveAssignment.size();
|
_size = moveAssignment.size();
|
||||||
moveAssignment._buffer = nullptr;
|
moveAssignment._buffer = nullptr;
|
||||||
|
|
Loading…
Reference in New Issue