Fixes NPE when NetworkingModule runs onCatalystInstanceDestroy
Reviewed By: andreicoman11 Differential Revision: D3328278 fbshipit-source-id: 7cf43a4564b2b799b13307f8604eb48e5c512379
This commit is contained in:
parent
913b4ccee4
commit
4378ecb8e1
|
@ -32,4 +32,8 @@ public class OkHttpCallUtil {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void cancelAll(OkHttpClient client) {
|
||||
client.dispatcher().cancelAll();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -138,7 +138,7 @@ public final class NetworkingModule extends ReactContextBaseJavaModule {
|
|||
@Override
|
||||
public void onCatalystInstanceDestroy() {
|
||||
mShuttingDown = true;
|
||||
OkHttpCallUtil.cancelTag(mClient, null);
|
||||
OkHttpCallUtil.cancelAll(mClient);
|
||||
|
||||
mCookieHandler.destroy();
|
||||
mCookieJarContainer.removeCookieJar();
|
||||
|
|
Loading…
Reference in New Issue