fix memory leak in Chrome debugging

Summary:
`RCTWebSocketExecutor` saves every WebSocket callback when sending message to chrome, but does not clear them in a debug session until the JS bridge is reloaded, and there may be thousands of blocks saved in the callback table. This PR removes them after they are called.
Closes https://github.com/facebook/react-native/pull/11341

Differential Revision: D4295710

Pulled By: javache

fbshipit-source-id: 29a02d1aba320115bbb97aee8981e34b89303c91
This commit is contained in:
Eming Kwok 2016-12-07 17:11:57 -08:00 committed by Facebook Github Bot
parent 38d275f8b5
commit 40b84fa5f8
1 changed files with 1 additions and 0 deletions

View File

@ -141,6 +141,7 @@ RCT_EXPORT_MODULE()
RCTWSMessageCallback callback = _callbacks[messageID];
if (callback) {
callback(error, reply);
[_callbacks removeObjectForKey:messageID];
}
}