summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2017-09-05 22:14:56 +0200
committerLoic Blot <loic.blot@unix-experience.fr>2017-09-05 22:14:56 +0200
commita3c298e1d1f02634e87c7ba1746fd7e9ed444875 (patch)
tree0d8812791efe7a0926903305380dd4876eb0ac0e /src/util
parentf231112cc4f0c1fe7f8bb937a49e4469157a2fa7 (diff)
downloadminetest-a3c298e1d1f02634e87c7ba1746fd7e9ed444875.tar.gz
minetest-a3c298e1d1f02634e87c7ba1746fd7e9ed444875.tar.bz2
minetest-a3c298e1d1f02634e87c7ba1746fd7e9ed444875.zip
Use a Buffer instead of SharedBuffer in ConnectionCommand
This fixes #6373
Diffstat (limited to 'src/util')
-rw-r--r--src/util/pointer.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/util/pointer.h b/src/util/pointer.h
index efca62d2d..59b6f5216 100644
--- a/src/util/pointer.h
+++ b/src/util/pointer.h
@@ -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();