Apply singleton instance binding clean-up fix no matter how it is created - #1908
Apply singleton instance binding clean-up fix no matter how it is created#1908dsnopek wants to merge 1 commit into
Conversation
|
Hi @dsnopek so the game does not crash, but the Godot Editor (beta2) still crashes on exit. I am updating my local windows builds to rc2 with debug symbols and will report back. With rc2 debug symbols enabled This includes the godot-cpp v10 patch from this PR |
|
@dsnopek where does this stand? |
|
I haven't had a chance to come back to it. I know I tested this when I made the PR, but other than the automated test this adds, I don't recall how I was doing that. But however I was testing it, it didn't crash for me like in your testing. Can you share an MRP that I can use? |
|
Hi @dsnopek you can find a simple MRP: In the Then load the sample project from If you remove the for loop in the NOTE: The MRP is using |
|
I can reproduce the crash from the above MRP on macOS, and this PR doesn't fix it. |
This has been the source of a number of concerns I've seen here and there, as the engine often does some early startup in other singletons that isn't always refired when the Is there a better way to unify this loading so we have consistent behavior? |
|
It might be possible to add a 'do not skip unnecessary work' flag to the engine startup. However, that sounds like it could be intrusive to a lot of code. The realistic solution is probably to add more test cases so our CI has this covered. Import with a GDExtension installed is common enough that we should be testing it, if not as part of the PR CI, at least regularly. |
|
MRP backtraces to This suggests it's not a godot-cpp bug, but a documentation / shutdown bug. Wouldn't be the first one to interplay badly with GDExtensions. |
|
Perhaps we should have this discussion on the issue? Even if this PR doesn't fix the crash described in #1900, it does fix a crash that I'm able to reproduce (via the test this PR adds). For that reason, maybe I should just disconnect this PR from that issue, and this can be evaluated on its own, while we continue to debug #1900 there? |
ba9900f to
922e1ee
Compare
922e1ee to
589b8e5
Compare
This was originally created in an attempt to address #1900
It does fix a crash that I'm able to reproduce when accessing a singleton via
Engine::get_singleton()->get_singleton("Name")which I've added a test for.This fix is a little weird in that it only addresses the
Wrapped(GodotObject *)constructor, but I think that's actually correct, because we only want to do this when the instance binding creation was initiated on the engine side using a pre-existing instance. If someone creates a new instance of a singleton (which they really shouldn't do, but there's nothing preventing it) then it shouldn't register that as an engine singleton.However, it seems it's still possible to reproduce #1900 even with this PR