Fixes NPE when NetworkingModule runs onCatalystInstanceDestroy

Reviewed By: andreicoman11

Differential Revision: D3328278

fbshipit-source-id: 7cf43a4564b2b799b13307f8604eb48e5c512379
This commit is contained in:
Konstantin Raev authored and Facebook Github Bot 0 committed 2016-05-23 04:44:11 -07:00
1 parent 913b4ccee4
commit 4378ecb8e1
2 files changed
+5 -1

No files matched your search

@@ -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();