godotengine / godotengine/godot-cpp

Using pointers as part of properties crash the editor without any error

Open
#1,105 0 comments 0 reactions 0 assignees View on GitHub
crash topic:gdextension
Dominant language
C++
Stars
2.7k
Forks
809
Avg merge
1d 3h
Merged PRs (30d)
8

Description

so I was trying to get a reference to an AudioStreamPlayer from the Scene tree using properties. but for some reason when the property is returning through it's getter it just crashes the editor it doesn't even have any error messages

![image](https://user-images.githubusercontent.com/25046370/235541414-2d909c2d-2122-4ca6-9261-f00c52b40ea0.png)

steps to reproduce:
1. start a new project with the latest version of godot and the latest version of GDExtension
2. create a custom class that has a getter an a setter with the getter returning a pointer to the AudioStreamPlayer
3. set the AudioStreamPlayer into the editor property slot
4. experience a super silent crash

EDIT: after further testing it appears that any object that is passed with a pointer to the `ClassDB::add_property()` bind ends up crashing the editor, and under as of now unknown conditions it doesn't crash, the crashing seems to be consistent though

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.