You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attempted to push_back an invalid (previously freed?) object instance into a 'TypedArray.
This crashes:
func testObjectNotLost() {
let variant = Variant(Object())
let methodListVariant: Variant
switch variant.call(method: "get_method_list") {
case .success(let variant):
methodListVariant = variant
case .failure(let error):
XCTFail("Could not get method list, error: \(error)")
return
}
guard let methodList = GArray(methodListVariant) else {
XCTFail("Could not get method list, got \(methodListVariant.gtype) instead")
return
}
XCTAssertFalse(methodList.isEmpty())
}
Note:
Only framework types are affected
RefCounted-inherited types are not affected
The text was updated successfully, but these errors were encountered:
elijah-semyonov
changed the title
A bug when Object is wrapped into a Variant and pushed into GArray
A bug when Object is inline-wrapped into a Variant.
Oct 8, 2024
The problem is due to Object shouldn't be freed by Swift without an explicit free, Objects don't have refcounted semantics, so Godot doesn't even try to increment their ref counter, when receiving it from Swift world.
This test fails:
Console prints:
This crashes:
Note:
Only framework types are affected
RefCounted-inherited types are not affected
The text was updated successfully, but these errors were encountered: