Fixed memory leak with String objects
The member _godot_string should never be straight out overwritten ever without first destroying the underlying string object's memory. This change solves the problem through the introduction of a new private constructor to create String objects with a pre-existing godot_string handle.
This commit is contained in:
@@ -29,6 +29,9 @@ public:
|
||||
class String {
|
||||
godot_string _godot_string;
|
||||
|
||||
String(godot_string contents) :
|
||||
_godot_string(contents) {}
|
||||
|
||||
public:
|
||||
String();
|
||||
String(const char *contents);
|
||||
|
||||
Reference in New Issue
Block a user