mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2026-10-12 08:37:11 +02:00
Implement a constructor in the lightweight object type that copies a regular object.
This commit is contained in:
1 parent
b4b00caba9
commit
15c824ddae
1 file changed
+12
@@ -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
|
||||
///
|
||||
|
||||
Reference in new issue
Block a user