Clear Fresco memory cache in onHostDestroy

Summary: `onHostDestroy` is when the app is backgrounded and all Activities are destroyed. At this point it's safe to clear Fresco's memory cache.

Reviewed By: AaaChiuuu

Differential Revision: D4674950

fbshipit-source-id: f6db658ad56e3ad843cd2acfa31e2df1c40d3279
This commit is contained in:
Felix Oghina
2017-03-10 06:36:16 -08:00
committed by Facebook Github Bot
parent 75e783d913
commit d9ae27ba89
2 changed files with 47 additions and 5 deletions

View File

@@ -148,7 +148,7 @@ public class MainReactPackage extends LazyReactPackage {
new ModuleSpec(FrescoModule.class, new Provider<NativeModule>() {
@Override
public NativeModule get() {
return new FrescoModule(context, mConfig != null ? mConfig.getFrescoConfig() : null);
return new FrescoModule(context, true, mConfig != null ? mConfig.getFrescoConfig() : null);
}
}),
new ModuleSpec(I18nManagerModule.class, new Provider<NativeModule>() {