Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GDExtension] getting various objects crashes Godot #609

Closed
BastiaanOlij opened this issue Sep 4, 2021 · 5 comments
Closed

[GDExtension] getting various objects crashes Godot #609

BastiaanOlij opened this issue Sep 4, 2021 · 5 comments
Assignees
Labels
topic:gdextension This relates to the new Godot 4 extension implementation
Milestone

Comments

@BastiaanOlij
Copy link
Collaborator

Looks like something broke in the last few days that causes Godot to become unstable when fetching certain object.

The test project in the repo fails on Example::return_something_const(), the failure happens when it attempts to obtain the viewport with the get_viewport() call. It looks like the object returned is getting released before its time.

@BastiaanOlij BastiaanOlij added the topic:gdextension This relates to the new Godot 4 extension implementation label Sep 4, 2021
@BastiaanOlij BastiaanOlij added this to the 4.0 milestone Sep 4, 2021
@victorholt
Copy link

Looks like something broke in the last few days that causes Godot to become unstable when fetching certain object.

The test project in the repo fails on Example::return_something_const(), the failure happens when it attempts to obtain the viewport with the get_viewport() call. It looks like the object returned is getting released before its time.

So, I know this is not a solution, and I haven't looked into preventing the crash when using get_viewport(), however I did notice that if you place the following:

get_viewport()->duplicate();

somewhere in your code (I placed mine in an AppController::_ready() method), the crash is prevented when closing the application. Again, not a solution, but if you're just trying to get past the crash it helps..., also may give some insight into a solution I hope.

@vnen
Copy link
Member

vnen commented Sep 13, 2021

Is this still a problem? Last time I checked the issue in the test project was fixed.

@victorholt
Copy link

This may not be relevant, but I did recently (today) create a fresh GDNative project (not GDExtension) and experienced the crash when calling get_viewport() and closing the app. The issue happens (for me) only as the application is closing.

@vnen
Copy link
Member

vnen commented Sep 17, 2021

@victorholt GDNative isn't supported anymore on the Godot master branch.

@BastiaanOlij
Copy link
Collaborator Author

BastiaanOlij commented Sep 18, 2021

@vnen sorry yes, this works fine in Godot extensions now thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic:gdextension This relates to the new Godot 4 extension implementation
Projects
None yet
Development

No branches or pull requests

3 participants