Avoid leaking FrescoModule when setting SoLoaderShim handler
Summary: The anonymous class had an implicit reference back to FrescoModule that would in turn retain the context. public Reviewed By: astreet Differential Revision: D2690747 fb-gh-sync-id: 8a97c102e461b903c6adf7c65956baf364fa5faf
This commit is contained in:
parent
5387df8dc5
commit
69c8dd50fe
|
@ -65,13 +65,7 @@ public class FrescoModule extends ReactContextBaseJavaModule implements
|
|||
super.initialize();
|
||||
// Make sure the SoLoaderShim is configured to use our loader for native libraries.
|
||||
// This code can be removed if using Fresco from Maven rather than from source
|
||||
SoLoaderShim.setHandler(
|
||||
new SoLoaderShim.Handler() {
|
||||
@Override
|
||||
public void loadLibrary(String libraryName) {
|
||||
SoLoader.loadLibrary(libraryName);
|
||||
}
|
||||
});
|
||||
SoLoaderShim.setHandler(new FrescoHandler());
|
||||
|
||||
HashSet<RequestListener> requestListeners = new HashSet<>();
|
||||
requestListeners.add(new SystraceRequestListener());
|
||||
|
@ -110,4 +104,11 @@ public class FrescoModule extends ReactContextBaseJavaModule implements
|
|||
imagePipelineFactory.getMainDiskStorageCache().clearAll();
|
||||
imagePipelineFactory.getSmallImageDiskStorageCache().clearAll();
|
||||
}
|
||||
|
||||
private static class FrescoHandler implements SoLoaderShim.Handler {
|
||||
@Override
|
||||
public void loadLibrary(String libraryName) {
|
||||
SoLoader.loadLibrary(libraryName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue