Specialize the buffer creation functions.

This commit is contained in:
Sandu Liviu Catalin committed 2016-06-20 14:52:05 +03:00
1 parent c2ac1f3fd8
commit ad55025bc8
3 files changed
+64 -1

No files matched your search

+4 -1
View File
@@ -7,6 +7,9 @@
// ------------------------------------------------------------------------------------------------
namespace SqMod {
// ------------------------------------------------------------------------------------------------
extern Object CreateBufferWrapperMove(Buffer && b);
// ------------------------------------------------------------------------------------------------
void Core::EmitCustomEvent(Int32 group, Int32 header, Object & payload)
{
@@ -1066,7 +1069,7 @@ void Core::EmitClientScriptData(Int32 player_id, const uint8_t * data, size_t si
// Replicate the data to the allocated buffer
b.Write(0, reinterpret_cast< Buffer::ConstPtr >(data), size);
// Wrap the buffer into a script object
const Object o = MakeObject(m_VM, BufferWrapper(std::move(b)));
const Object o = CreateBufferWrapperMove(std::move(b));
// Wrap the buffer into a script object
if (o.IsNull())
{