-
-
Notifications
You must be signed in to change notification settings - Fork 589
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
Fixing reference return #662
Conversation
6b27168
to
cb31506
Compare
At this point in time I'm getting a crash when closing the editor after loading the project. Also property inspector stopped working again. |
1b71eb2
to
eb9da86
Compare
eb9da86
to
fd91042
Compare
The crash I mention here is caused by our issues with initialization, because we have our print in our construct the editor starts constructing additional object and that messes everything up. Groud is working on a rewrite of that. We have a workaround by moving the line |
fd91042
to
90429ed
Compare
These are likely related to refcounting issues. The change in the SConstruct script fixes a crash that occured somewhere in `bind_get_argument_type` when registering classes and binding methods. Commenting out the `delete`s in destructors fixed a `double free or corruption` crash that occured after the fix described above. Likely related to godotengine/godot-cpp#652, but neither godotengine/godot-cpp#660 or godotengine/godot-cpp#662 seemed to help...
Although we already wrote about this in the gdextension Godot chat, I'm summarizing it again here so it doesn't get lost there: I was getting the following compile error when compiling my GDExtension with this PR (both on your branch and on origin/master with this commit cherry-picked):
Note that GeoPoint, GeoLine, and GeoPolygon all inherit from GeoFeature, which inherits from Resource. Seems to be related to this additional layer of inheritance. I could work around this error by manually making all members of |
-Creating from object pointer via funcptr API was missing reference initialization. -Supersedes godotengine/godot-cpp#662 -Fixes several crashes in GDExtension
90429ed
to
287e1cb
Compare
Now basing this on including godotengine/godot#57968 for an upstream fix, so mostly just test cases left. |
@@ -9,9 +9,12 @@ func _ready(): | |||
($Example as Example).simple_const_func() # Force use of ptrcall | |||
prints("returned", $Example.return_something("some string")) | |||
prints("returned const", $Example.return_something_const()) | |||
prints("returned ref", $Example.return_extended_ref()) | |||
|
|||
prints("returned example ref object: ", $Example.return_extended_ref()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did this mean to say "extended" instead of "example"?
These are likely related to refcounting issues. The change in the SConstruct script fixes a crash that occured somewhere in `bind_get_argument_type` when registering classes and binding methods. Commenting out the `delete`s in destructors fixed a `double free or corruption` crash that occured after the fix described above. Likely related to godotengine/godot-cpp#652, but neither godotengine/godot-cpp#660 or godotengine/godot-cpp#662 seemed to help...
-Creating from object pointer via funcptr API was missing reference initialization. -Supersedes godotengine/godot-cpp#662 -Fixes several crashes in GDExtension
Superseded by #958. |
Investigating various issues around using reference, adding use cases to the test project to test them and fixing them.
Note, things are currently broken on the Godot side until godotengine/godot#55282 is merged.
You can work around that issue by commenting out the print statements in the constructors of Example and ExampleRef.