summaryrefslogtreecommitdiffstats
path: root/include/core/Array.hpp
diff options
context:
space:
mode:
authorsheepandshepherd <sheepandshepherd@hotmail.com>2019-12-04 21:12:59 +0100
committersheepandshepherd <sheepandshepherd@hotmail.com>2020-01-31 00:08:02 +0100
commit66c671b59dece97d523478cae7c602de6d423aa4 (patch)
treed2206102a8d43efeef21f3fe740ce3e36d4dbb6a /include/core/Array.hpp
parentaba8766618c6aa40c6f7b40b513e8e47cfa807f4 (diff)
downloadredot-cpp-66c671b59dece97d523478cae7c602de6d423aa4.tar.gz
Add C conversion constructors to fix leak of default-constructed empty arrays
Diffstat (limited to 'include/core/Array.hpp')
-rw-r--r--include/core/Array.hpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/core/Array.hpp b/include/core/Array.hpp
index d766c54..3d13914 100644
--- a/include/core/Array.hpp
+++ b/include/core/Array.hpp
@@ -57,6 +57,11 @@ class Object;
class Array {
godot_array _godot_array;
+ friend class Variant;
+ inline explicit Array(const godot_array &other) {
+ _godot_array = other;
+ }
+
public:
Array();
Array(const Array &other);