mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-22 17:18:39 +00:00
Use a Buffer instead of SharedBuffer in ConnectionCommand
This fixes #6373
This commit is contained in:
parent
f231112cc4
commit
a3c298e1d1
2 changed files with 13 additions and 1 deletions
|
@ -168,6 +168,18 @@ public:
|
|||
/*
|
||||
Copies whole buffer
|
||||
*/
|
||||
SharedBuffer(const Buffer<T> &buffer)
|
||||
{
|
||||
m_size = buffer.getSize();
|
||||
if (m_size != 0) {
|
||||
data = new T[m_size];
|
||||
memcpy(data, *buffer, buffer.getSize());
|
||||
}
|
||||
else
|
||||
data = NULL;
|
||||
refcount = new unsigned int;
|
||||
(*refcount) = 1;
|
||||
}
|
||||
~SharedBuffer()
|
||||
{
|
||||
drop();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue