Add C conversion constructors to fix leak of default-constructed empty arrays
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -12,6 +12,11 @@ namespace godot {
|
||||
class Dictionary {
|
||||
godot_dictionary _godot_dictionary;
|
||||
|
||||
friend Variant::operator Dictionary() const;
|
||||
inline explicit Dictionary(const godot_dictionary &other) {
|
||||
_godot_dictionary = other;
|
||||
}
|
||||
|
||||
public:
|
||||
Dictionary();
|
||||
Dictionary(const Dictionary &other);
|
||||
|
||||
Reference in New Issue
Block a user