diff options
author | Marc <marc.gilleron@gmail.com> | 2020-06-05 21:16:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-05 21:16:37 +0100 |
commit | ceae5be727cf58f7ff5d4856ceeedfccfd8b84b4 (patch) | |
tree | ac9a185d9395dc12867017740d8605b0a19be1b5 /src/core/Variant.cpp | |
parent | 8a797e2c09a2eabb9ae4555f83d9cf909fb716c4 (diff) | |
parent | 66c671b59dece97d523478cae7c602de6d423aa4 (diff) | |
download | redot-cpp-ceae5be727cf58f7ff5d4856ceeedfccfd8b84b4.tar.gz |
Merge pull request #356 from sheepandshepherd/variantleak2
Add C conversion constructors and fix new leak
Diffstat (limited to 'src/core/Variant.cpp')
-rw-r--r-- | src/core/Variant.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/core/Variant.cpp b/src/core/Variant.cpp index 4c5cfe6..86d2f91 100644 --- a/src/core/Variant.cpp +++ b/src/core/Variant.cpp @@ -261,14 +261,12 @@ Variant::operator RID() const { } Variant::operator Dictionary() const { - Dictionary ret; - *(godot_dictionary *)&ret = godot::api->godot_variant_as_dictionary(&_godot_variant); + Dictionary ret(godot::api->godot_variant_as_dictionary(&_godot_variant)); return ret; } Variant::operator Array() const { - Array ret; - *(godot_array *)&ret = godot::api->godot_variant_as_array(&_godot_variant); + Array ret(godot::api->godot_variant_as_array(&_godot_variant)); return ret; } |