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
{{ message }}
Repository navigation
[cronet_http] Potential problem when having multiple Flutter engines #1720
There is an issue with the context getter of package:jni that it will crash if used again after creating a second engine: dart-lang/native#1865
This is because the second engine sets it to another context invalid for the first one. Can we check if cronet_http is susceptible to this problem? (or maybe we store the context and it won't cause a crash/cronet doesn't really need the context so it doesn't cause a crash/etc.)
If yes, then we would want to add a warning to cronet_http's readme about the fact that it's not safe to use it when using multiple flutter engines.
The problem can be solved either if we find a different way of getting the global context, which might work well at least for cronet. Or by exposing an "engine ID", so we can keep a map of contexts per Flutter engine instead of a singleton: flutter/flutter#163430
I think ok_http is going to have same issue? This should be solvable once we have engineId that we can match between plugin initialization and ffi call.
Activity
knopp commentedon Feb 19, 2025
I think ok_http is going to have same issue? This should be solvable once we have
engineIdthat we can match between plugin initialization and ffi call.