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
During image decoding, avoid using smart pointers for DartWrappables that cross thread-boundaries.
In flutter#19843, a regression was introduced
where an image descriptor object that has a Dart peer could be collected on a
concurrent task runner thread. Collection of such object needs to enter isolate
scope which might still be active on the UI thread. [A comment in the original
commit explicitly mentions][1] this and attempts to achieve the collection of the
Dart wrappable on the UI task runner. However, the author missed that the object
was present in the captures of a copyable closure. These captures may be
released on any of the participating threads. To avoid the the indeterminism of
the smart pointer being dropped on the concurrent task runner thread, this patch
resorts to manually reference counting the descriptor.
Fixesflutter/flutter#72144
[1]: https://github.com/flutter/engine/pull/19843/files#diff-a3034d4a06133381b6b636d841ec98cb7cfce640f316dda9e71eda4d9e7872f6R227
0 commit comments