Skip to content

Commit

Permalink
Update packet.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsharabayko committed Aug 7, 2023
1 parent 39eebaf commit 4a91b9c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions srtcore/packet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ void CPacket::deallocate()
if (m_data_owned)
delete[](char*) m_PacketVector[PV_DATA].data();
m_PacketVector[PV_DATA].set(NULL, 0);
m_data_owned = false;
}

char* CPacket::release()
Expand All @@ -241,8 +242,7 @@ CPacket::~CPacket()
{
// PV_HEADER is always owned, PV_DATA may use a "borrowed" buffer.
// Delete the internal buffer only if it was declared as owned.
if (m_data_owned)
delete[](char*) m_PacketVector[PV_DATA].data();
deallocate();
}

size_t CPacket::getLength() const
Expand Down

0 comments on commit 4a91b9c

Please sign in to comment.