-
-
Notifications
You must be signed in to change notification settings - Fork 688
Open
Description
First of all, sorry for no stack trace: this is reproducible only with release builds for some reason...
Here's my code:
// goapplanner.cpp
void GOAPPlanner::initialize(Array actions) {
Godot::print(Object::cast_to<Node>(actions[0])->get("name").operator String());
}Here's the tree:
- parent
- agent
- empty_node (empty node of type Node with nothing inside)
- goapplanner (with GDNS running previous code)
Within agent, I have the following code:
func _ready():
$goapplanner.initialize([$empty_node])The above code succeeds and prints empty_node. However, when I unload the scene to load another (by using parent.queue_free()), the game segfaults.
If I move empty_node AFTER goapplanner, the crash does not happen.
This is strange since I don't even keep the reference to Node* anywhere, I just cast actions[0] to Node* and then throw it away. Do cast_to-ed objects have to be marked/freed somehow?
Any ideas about what's going on here?
Metadata
Metadata
Assignees
Labels
No labels