summaryrefslogtreecommitdiffstats
path: root/include/core/NodePath.hpp
diff options
context:
space:
mode:
authorMarc Gilleron <marc.gilleron@gmail.com>2021-01-07 01:05:12 +0000
committerMarc Gilleron <marc.gilleron@gmail.com>2021-01-07 01:05:12 +0000
commitfb71edd45b2473bf0ac502c777a1850fb564087e (patch)
tree5d7a48365313cd54a2a763efa85728c36cf7ed86 /include/core/NodePath.hpp
parent43828ebb3931b9117ad57f08cc457e052fdfd631 (diff)
downloadredot-cpp-fb71edd45b2473bf0ac502c777a1850fb564087e.tar.gz
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.
Diffstat (limited to 'include/core/NodePath.hpp')
-rw-r--r--include/core/NodePath.hpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/core/NodePath.hpp b/include/core/NodePath.hpp
index 221c5ce..36dda7d 100644
--- a/include/core/NodePath.hpp
+++ b/include/core/NodePath.hpp
@@ -10,6 +10,11 @@ namespace godot {
class NodePath {
godot_node_path _node_path;
+ friend class Variant;
+ inline explicit NodePath(godot_node_path node_path) {
+ _node_path = node_path;
+ }
+
public:
NodePath();