{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/react-native/pulls/comments/50040351","id":50040351,"diff_hunk":"@@ -49,22 +51,33 @@ - (void)dealloc\n   RCTSRWebSocket *webSocket = [[RCTSRWebSocket alloc] initWithURL:URL];\n   webSocket.delegate = self;\n   webSocket.reactTag = socketID;\n-  if (!_sockets) {\n+  static dispatch_once_t once;","path":"Libraries/WebSocket/RCTWebSocketModule.m","position":22,"original_position":22,"commit_id":"9e0c22c36407a9c7fb61c0c4b93916a375013cc1","original_commit_id":"9e0c22c36407a9c7fb61c0c4b93916a375013cc1","user":{"login":"ide","id":379606,"avatar_url":"https://avatars.githubusercontent.com/u/379606?v=3","gravatar_id":"","url":"https://api.github.com/users/ide","html_url":"https://github.com/ide","followers_url":"https://api.github.com/users/ide/followers","following_url":"https://api.github.com/users/ide/following{/other_user}","gists_url":"https://api.github.com/users/ide/gists{/gist_id}","starred_url":"https://api.github.com/users/ide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ide/subscriptions","organizations_url":"https://api.github.com/users/ide/orgs","repos_url":"https://api.github.com/users/ide/repos","events_url":"https://api.github.com/users/ide/events{/privacy}","received_events_url":"https://api.github.com/users/ide/received_events","type":"User","site_admin":false},"body":"AFAIK all instances will share this static variable.. better to initialize _sockets in the initializer","created_at":"2016-01-18T20:20:30Z","updated_at":"2016-01-18T20:20:30Z","html_url":"https://github.com/facebook/react-native/pull/5383#discussion_r50040351","pull_request_url":"https://api.github.com/repos/facebook/react-native/pulls/5383","_links":{"self":{"href":"https://api.github.com/repos/facebook/react-native/pulls/comments/50040351"},"html":{"href":"https://github.com/facebook/react-native/pull/5383#discussion_r50040351"},"pull_request":{"href":"https://api.github.com/repos/facebook/react-native/pulls/5383"}}},"pull_request":{"url":"https://api.github.com/repos/facebook/react-native/pulls/5383","id":56386459,"html_url":"https://github.com/facebook/react-native/pull/5383","diff_url":"https://github.com/facebook/react-native/pull/5383.diff","patch_url":"https://github.com/facebook/react-native/pull/5383.patch","issue_url":"https://api.github.com/repos/facebook/react-native/issues/5383","number":5383,"state":"open","locked":false,"title":"Fix race condition in RCTWebSocketModule.m","user":{"login":"greghe","id":5883925,"avatar_url":"https://avatars.githubusercontent.com/u/5883925?v=3","gravatar_id":"","url":"https://api.github.com/users/greghe","html_url":"https://github.com/greghe","followers_url":"https://api.github.com/users/greghe/followers","following_url":"https://api.github.com/users/greghe/following{/other_user}","gists_url":"https://api.github.com/users/greghe/gists{/gist_id}","starred_url":"https://api.github.com/users/greghe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greghe/subscriptions","organizations_url":"https://api.github.com/users/greghe/orgs","repos_url":"https://api.github.com/users/greghe/repos","events_url":"https://api.github.com/users/greghe/events{/privacy}","received_events_url":"https://api.github.com/users/greghe/received_events","type":"User","site_admin":false},"body":"NSMutableDictionary and related classes are not thread-safe. Discovered while NSZombie objects were enabled.","created_at":"2016-01-18T20:13:21Z","updated_at":"2016-01-18T20:20:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"99857caf57cb0f3f12d6442dfc3754780012b6af","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/facebook/react-native/pulls/5383/commits","review_comments_url":"https://api.github.com/repos/facebook/react-native/pulls/5383/comments","review_comment_url":"https://api.github.com/repos/facebook/react-native/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/5383/comments","statuses_url":"https://api.github.com/repos/facebook/react-native/statuses/9e0c22c36407a9c7fb61c0c4b93916a375013cc1","head":{"label":"greghe:fix-websocket-race-condition","ref":"fix-websocket-race-condition","sha":"9e0c22c36407a9c7fb61c0c4b93916a375013cc1","user":{"login":"greghe","id":5883925,"avatar_url":"https://avatars.githubusercontent.com/u/5883925?v=3","gravatar_id":"","url":"https://api.github.com/users/greghe","html_url":"https://github.com/greghe","followers_url":"https://api.github.com/users/greghe/followers","following_url":"https://api.github.com/users/greghe/following{/other_user}","gists_url":"https://api.github.com/users/greghe/gists{/gist_id}","starred_url":"https://api.github.com/users/greghe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greghe/subscriptions","organizations_url":"https://api.github.com/users/greghe/orgs","repos_url":"https://api.github.com/users/greghe/repos","events_url":"https://api.github.com/users/greghe/events{/privacy}","received_events_url":"https://api.github.com/users/greghe/received_events","type":"User","site_admin":false},"repo":{"id":49901712,"name":"react-native","full_name":"greghe/react-native","owner":{"login":"greghe","id":5883925,"avatar_url":"https://avatars.githubusercontent.com/u/5883925?v=3","gravatar_id":"","url":"https://api.github.com/users/greghe","html_url":"https://github.com/greghe","followers_url":"https://api.github.com/users/greghe/followers","following_url":"https://api.github.com/users/greghe/following{/other_user}","gists_url":"https://api.github.com/users/greghe/gists{/gist_id}","starred_url":"https://api.github.com/users/greghe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greghe/subscriptions","organizations_url":"https://api.github.com/users/greghe/orgs","repos_url":"https://api.github.com/users/greghe/repos","events_url":"https://api.github.com/users/greghe/events{/privacy}","received_events_url":"https://api.github.com/users/greghe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/greghe/react-native","description":"A framework for building native apps with React.","fork":true,"url":"https://api.github.com/repos/greghe/react-native","forks_url":"https://api.github.com/repos/greghe/react-native/forks","keys_url":"https://api.github.com/repos/greghe/react-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/greghe/react-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/greghe/react-native/teams","hooks_url":"https://api.github.com/repos/greghe/react-native/hooks","issue_events_url":"https://api.github.com/repos/greghe/react-native/issues/events{/number}","events_url":"https://api.github.com/repos/greghe/react-native/events","assignees_url":"https://api.github.com/repos/greghe/react-native/assignees{/user}","branches_url":"https://api.github.com/repos/greghe/react-native/branches{/branch}","tags_url":"https://api.github.com/repos/greghe/react-native/tags","blobs_url":"https://api.github.com/repos/greghe/react-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/greghe/react-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/greghe/react-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/greghe/react-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/greghe/react-native/statuses/{sha}","languages_url":"https://api.github.com/repos/greghe/react-native/languages","stargazers_url":"https://api.github.com/repos/greghe/react-native/stargazers","contributors_url":"https://api.github.com/repos/greghe/react-native/contributors","subscribers_url":"https://api.github.com/repos/greghe/react-native/subscribers","subscription_url":"https://api.github.com/repos/greghe/react-native/subscription","commits_url":"https://api.github.com/repos/greghe/react-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/greghe/react-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/greghe/react-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/greghe/react-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/greghe/react-native/contents/{+path}","compare_url":"https://api.github.com/repos/greghe/react-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/greghe/react-native/merges","archive_url":"https://api.github.com/repos/greghe/react-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/greghe/react-native/downloads","issues_url":"https://api.github.com/repos/greghe/react-native/issues{/number}","pulls_url":"https://api.github.com/repos/greghe/react-native/pulls{/number}","milestones_url":"https://api.github.com/repos/greghe/react-native/milestones{/number}","notifications_url":"https://api.github.com/repos/greghe/react-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/greghe/react-native/labels{/name}","releases_url":"https://api.github.com/repos/greghe/react-native/releases{/id}","created_at":"2016-01-18T20:02:04Z","updated_at":"2016-01-18T20:02:08Z","pushed_at":"2016-01-18T20:11:42Z","git_url":"git://github.com/greghe/react-native.git","ssh_url":"git@github.com:greghe/react-native.git","clone_url":"https://github.com/greghe/react-native.git","svn_url":"https://github.com/greghe/react-native","homepage":"http://facebook.github.io/react-native/","size":40141,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"58fc0f07bdb885dd21546636c467564b516ac3d7","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":29028775,"name":"react-native","full_name":"facebook/react-native","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/react-native","description":"A framework for building native apps with React.","fork":false,"url":"https://api.github.com/repos/facebook/react-native","forks_url":"https://api.github.com/repos/facebook/react-native/forks","keys_url":"https://api.github.com/repos/facebook/react-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/react-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/react-native/teams","hooks_url":"https://api.github.com/repos/facebook/react-native/hooks","issue_events_url":"https://api.github.com/repos/facebook/react-native/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/react-native/events","assignees_url":"https://api.github.com/repos/facebook/react-native/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/react-native/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/react-native/tags","blobs_url":"https://api.github.com/repos/facebook/react-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/react-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/react-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/react-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/react-native/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/react-native/languages","stargazers_url":"https://api.github.com/repos/facebook/react-native/stargazers","contributors_url":"https://api.github.com/repos/facebook/react-native/contributors","subscribers_url":"https://api.github.com/repos/facebook/react-native/subscribers","subscription_url":"https://api.github.com/repos/facebook/react-native/subscription","commits_url":"https://api.github.com/repos/facebook/react-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/react-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/react-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/react-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/react-native/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/react-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/react-native/merges","archive_url":"https://api.github.com/repos/facebook/react-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/react-native/downloads","issues_url":"https://api.github.com/repos/facebook/react-native/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/react-native/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/react-native/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/react-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/react-native/labels{/name}","releases_url":"https://api.github.com/repos/facebook/react-native/releases{/id}","created_at":"2015-01-09T18:10:16Z","updated_at":"2016-01-18T18:51:00Z","pushed_at":"2016-01-18T20:13:21Z","git_url":"git://github.com/facebook/react-native.git","ssh_url":"git@github.com:facebook/react-native.git","clone_url":"https://github.com/facebook/react-native.git","svn_url":"https://github.com/facebook/react-native","homepage":"http://facebook.github.io/react-native/","size":71848,"stargazers_count":25910,"watchers_count":25910,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":4521,"mirror_url":null,"open_issues_count":980,"forks":4521,"open_issues":980,"watchers":25910,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/react-native/pulls/5383"},"html":{"href":"https://github.com/facebook/react-native/pull/5383"},"issue":{"href":"https://api.github.com/repos/facebook/react-native/issues/5383"},"comments":{"href":"https://api.github.com/repos/facebook/react-native/issues/5383/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/react-native/pulls/5383/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/react-native/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/react-native/pulls/5383/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/react-native/statuses/9e0c22c36407a9c7fb61c0c4b93916a375013cc1"}}}}