Fix a problem with the completer not unregistering the listener.

This fixes a bug found by @afnx and reported in flutter/flutter#22754
This commit is contained in:
Greg Spencer
2018-10-08 17:11:38 -07:00
committed by GitHub

View File

@ -185,6 +185,7 @@ class PaletteGenerator extends Diagnosticable {
Timer loadFailureTimeout;
void imageListener(ImageInfo info, bool synchronousCall) {
loadFailureTimeout?.cancel();
stream.removeListener(imageListener);
imageCompleter.complete(info.image);
}