-
Notifications
You must be signed in to change notification settings - Fork 256
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
Bug: Try to use RustArc<dynamic>
after it has been disposed
#1937
Comments
Hi, could you please firstly check whether |
Yes,
In my real app, there's an ergonomics issue too. If this isn't a bug, adding one opaque leaf field then requires converting the entire object tree to opaque to keep correctness? |
As a bit more context, I was hoping to keep as much data non opaque as possible. It's not performance intensive, but my structs have a bunch of |
When ItemContainer is non-opaque (i.e. like a "plain old java object (POJO)"), the whole object (with each of its field) is constructed each time it is called, no matter whether there is
Btw I am thinking about another feature: Even if something is opaque, if it has
Then we get this in Dart
What do you think? |
I like the automatic getters and setters. It would be nice to have an annotation to turn them off if I want to write my own impl for them. I think maybe there should be an error if combining |
Oh one more point, not sure if it's relevant, but my |
I guess one way is to only generate for
Yes, the semantics is somehow a problem. Some more discussions are in #1906 (comment) |
I ran into this issue once again, because many of my non_opaque structs had one opaque struct deeply nested inside. I do not really understand why this causes issues, but it seems like having structs which are made up of opaque structs essentially makes them kinda "poisoned", if they are not also opaque. Seems to me that having the ability to create explicitly non_opaque structs does not really make sense then if its so easy to misuse, and the idea with the automatically gen getters would solve the problem, right? Or would that not change a thing either? |
I am considering some changes like: For non-opaque structs, support code such as
Then, you can use |
Now auto getters/setters of opaque types is supported: https://cjycode.com/flutter_rust_bridge/guides/types/arbitrary/rust-auto-opaque/properties And, opaque types can also be inside non-opaque types: https://cjycode.com/flutter_rust_bridge/guides/types/arbitrary/rust-auto-opaque/opaque-in-translatable Thus closing this. Feel free to reopen if needed! |
Describe the bug
I'm stuck on an error that seems to be an error in the serialization strategy for inner opaque objects.
In calling a function that serializes a Vec, it causes a
Try to use
RustArcafter it has been disposed
. In the code below, it occurs on the second call togetItemContents
.In the example below, the VecDeque can be replaced by any other type.
It doesn't make a difference if I have full_dep: true or not, or whether I label the offending function
serialize
to try to get the SSE codec. Haven't managed to find any workaround yet.Steps to reproduce
Up-to-date flutter.
Confirmed to occur on frb 32 or 33.
Error occurs in flutter web in up-to-date Chrome.
simple.rs: (Here, we take
VecDeque
as a placeholder for an arbitrary opaque object.)Logs
Expected behavior
No response
Generated binding code
No response
OS
No response
Version of
flutter_rust_bridge_codegen
No response
Flutter info
No response
Version of
clang++
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: