1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 00:37:15 +01:00

Implement a constructor in the lightweight object type that copies a regular object.

This commit is contained in:
Sandu Liviu Catalin 2016-11-17 10:59:19 +02:00
parent b4b00caba9
commit 15c824ddae

View File

@ -711,6 +711,18 @@ struct LightObject {
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Construct a LightObject from a regular Object instance.
///
/// \param so Object to copy
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
LightObject(const Object& obj) : mObj(obj.GetObject()) {
if (!sq_isnull(mObj)) {
sq_addref(obj.GetVM(), &mObj);
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Constructs an LightObject from a C++ instance
///