Fix container and string leaks
Some functions return a new instance of such containers, but instead we made a copy of them, without taking ownership of the original created by the function. Now we use a specific constructor taking ownership on the godot_* struct.
This commit is contained in:
@@ -29,7 +29,10 @@ public:
|
||||
class String {
|
||||
godot_string _godot_string;
|
||||
|
||||
String(godot_string contents) :
|
||||
friend class Dictionary;
|
||||
friend class NodePath;
|
||||
friend class Variant;
|
||||
explicit inline String(godot_string contents) :
|
||||
_godot_string(contents) {}
|
||||
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user