- Notifications
You must be signed in to change notification settings - Fork78
Description
Hey there! I'm just getting started withflutter-rs
and I think it looks really neat. It looks like I've caught this at a bit of a transition period, but I'm working through it. I found that the template repository won't compile, but I fount out how to get it to work by switching toflutter_glfw
instead of usingflutter_winit
. I also had to make some modifications tocargo-flutter
to fix bundling problems. ( if it's useful I can submit PRs for both of those repos with what fixed it for me )
Now I've got everything working except for one problem I can't figure out how to fix: when closing the application by clicking the window-manager "x" button, the application freezes and goes into "not responding". The apparent cause is shown in the debug logs:
[2021-05-03T14:33:17Z DEBUG glfw] Attempted to drop a Window before the `RenderContext` was dropped.[2021-05-03T14:33:17Z DEBUG glfw] Blocking until the `RenderContext` was dropped.
I dove into the code to try and figure out how to fix it, but I'm kind of stuck. As far as I can tell, when the window loop exits there are still two strong references to theArc
that holds theFlutterEngine
, which in turn is holding theRenderContext
that glfw is complaining about. After a couple hours or so trying to debug, though, I can't figure out what is holding the references to thatArc
and how to get it to shut-down. It's also worth noting that theengine.shutdown()
function never returns.
I'm willing to try to fix it, but I need some pointers to be able to make futher progress I think.