fix: WifiManagerLeak

This commit is contained in:
Mark Vayngrib 2017-12-08 10:24:17 -05:00
parent 4a3d903cc0
commit c48e42d449
1 changed files with 1 additions and 0 deletions

View File

@ -172,6 +172,7 @@ public final class UdpSockets extends ReactContextBaseJavaModule
if (mMulticastLock == null) { if (mMulticastLock == null) {
WifiManager wifiMgr = (WifiManager) getReactApplicationContext() WifiManager wifiMgr = (WifiManager) getReactApplicationContext()
.getApplicationContext()
.getSystemService(Context.WIFI_SERVICE); .getSystemService(Context.WIFI_SERVICE);
mMulticastLock = wifiMgr.createMulticastLock("react-native-udp"); mMulticastLock = wifiMgr.createMulticastLock("react-native-udp");
mMulticastLock.setReferenceCounted(true); mMulticastLock.setReferenceCounted(true);