-
Notifications
You must be signed in to change notification settings - Fork 76
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
Add RefCounted.unref() to manage lifetime of RefCounted objects #375
base: main
Are you sure you want to change the base?
Conversation
To truly fix this completely we might want to define a property wrapper for owned references to |
Related fix, we currently leak variants, which is only a problem with those that come with juicy payloads. I have a patch for that, that I have been testing. This no longer crashes for me: https://gist.github.com/migueldeicaza/652c9665459cf05a3cad856ad91d11c8 |
I have manually merged the 'unref' bits. I would love to merge some of the overall build-system changes to build on Linux, independently of the actual test suite changes. I think those would be nice to have while we sort out the rest. |
This calls new extension function mem_release() to decrement reference count and actually delete object when it goes to 0.
This already existed in the extension functions. Rename system library to libgodot_system, for use by target SwiftGodotTestability.
On macOS use .binaryTarget(name: "libgodot_binary") and reference with libgodot_dependency. On other platforms use .systemLibrary(name: "libgodot_system") and reference with libgodot_dependency.
Use local blocks instead to ensure memory is cleaned up.
Change libgodot target dependencies to "libgodot_tests" on macOS.
Add --verbose flag to arguments array.
displayserver_set_runloop sets up a callback to give time to the main runloop. main_iteration calls Main::iteration() to give time to the Godot main loop.
Also starts a timer that calls Main::iteration() while runloop has control. This is needed for when XCTest blocks the runloop until test expectations are finished.
Add additional runtime states.
This ensures all tests are run from inside a live Godot engine. Simplify GodotTestCase Avoids the need to use platform-specific XCTest details to arrange for a GodotEngine to be running during tests.
A more complete and comprehensive fix is now part of 0.45 (about to be released). |
Reopening, as this has other interesting bits |
This calls existing extension function object_destroy() when the object's reference count goes to 0.
It is a partial solution to this issue migueldeicaza/SwiftGodotKit#25.