{"action":"created","issue":{"url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/16719","repository_url":"https://api.github.com/repos/cocos2d/cocos2d-x","labels_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/16719/labels{/name}","comments_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/16719/comments","events_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/16719/events","html_url":"https://github.com/cocos2d/cocos2d-x/issues/16719","id":183698369,"number":16719,"title":"(iOS) Crash after receive applicationDidReceiveMemoryWarning ","user":{"login":"letrungtrung","id":7106318,"avatar_url":"https://avatars.githubusercontent.com/u/7106318?v=3","gravatar_id":"","url":"https://api.github.com/users/letrungtrung","html_url":"https://github.com/letrungtrung","followers_url":"https://api.github.com/users/letrungtrung/followers","following_url":"https://api.github.com/users/letrungtrung/following{/other_user}","gists_url":"https://api.github.com/users/letrungtrung/gists{/gist_id}","starred_url":"https://api.github.com/users/letrungtrung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/letrungtrung/subscriptions","organizations_url":"https://api.github.com/users/letrungtrung/orgs","repos_url":"https://api.github.com/users/letrungtrung/repos","events_url":"https://api.github.com/users/letrungtrung/events{/privacy}","received_events_url":"https://api.github.com/users/letrungtrung/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-18T14:12:56Z","updated_at":"2016-10-19T03:00:14Z","closed_at":null,"body":"The reason caused crash is \"on applicationDidReceiveMemoryWarning  function exist code calling cocos2d::Director::getInstance()->purgeCachedData();\"\r\n\r\nSteps to Reproduce:\r\n\r\n1. add texturePack with 3 sprite frames: A,B, C\r\n2. create sprite with sprite-frame A, B\r\n3. cocos2d::Director::getInstance()->purgeCachedData(); (simulate like function applicationDidReceiveMemoryWarning )\r\n4. create sprite with sprite frame C\r\n==> sprite frame C won't exist  ==> crash from \"Assert Failed! spriteFrame can't be nullptr!\"\r\n"},"comment":{"url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/comments/254697746","html_url":"https://github.com/cocos2d/cocos2d-x/issues/16719#issuecomment-254697746","issue_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/16719","id":254697746,"user":{"login":"panzhihao","id":22761531,"avatar_url":"https://avatars.githubusercontent.com/u/22761531?v=3","gravatar_id":"","url":"https://api.github.com/users/panzhihao","html_url":"https://github.com/panzhihao","followers_url":"https://api.github.com/users/panzhihao/followers","following_url":"https://api.github.com/users/panzhihao/following{/other_user}","gists_url":"https://api.github.com/users/panzhihao/gists{/gist_id}","starred_url":"https://api.github.com/users/panzhihao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/panzhihao/subscriptions","organizations_url":"https://api.github.com/users/panzhihao/orgs","repos_url":"https://api.github.com/users/panzhihao/repos","events_url":"https://api.github.com/users/panzhihao/events{/privacy}","received_events_url":"https://api.github.com/users/panzhihao/received_events","type":"User","site_admin":false},"created_at":"2016-10-19T03:00:13Z","updated_at":"2016-10-19T03:00:13Z","body":"there is not a map to record A,B,C for a plist in memory, it will clear all sprite frames if it is not unused.\r\nbefore using createSpriteFrame, you must to addSpriteFrames."}}
{"actor":{"display_login":"panzhihao"}}