mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
CanvasImageDecoder is instantiated with a callback into a Dart closure. That closure was holding references to the ImageDecoder and the returned Image. The circular reference between the ImageDecoder and the callback prevented the objects from being GCed, resulting in leakage of the image buffer. CanvasImageDecoder will now destroy the callback after it is invoked, thus releasing its handle to the Dart closure.