-
Notifications
You must be signed in to change notification settings - Fork 390
Description
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