{"action":"created","issue":{"url":"https://api.github.com/repos/openfl/openfl/issues/1369","repository_url":"https://api.github.com/repos/openfl/openfl","labels_url":"https://api.github.com/repos/openfl/openfl/issues/1369/labels{/name}","comments_url":"https://api.github.com/repos/openfl/openfl/issues/1369/comments","events_url":"https://api.github.com/repos/openfl/openfl/issues/1369/events","html_url":"https://github.com/openfl/openfl/issues/1369","id":193338486,"number":1369,"title":"Event dispatching works differently on OpenFL when listeners are added/removed inside an listener","user":{"login":"vroad","id":396351,"avatar_url":"https://avatars.githubusercontent.com/u/396351?v=3","gravatar_id":"","url":"https://api.github.com/users/vroad","html_url":"https://github.com/vroad","followers_url":"https://api.github.com/users/vroad/followers","following_url":"https://api.github.com/users/vroad/following{/other_user}","gists_url":"https://api.github.com/users/vroad/gists{/gist_id}","starred_url":"https://api.github.com/users/vroad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vroad/subscriptions","organizations_url":"https://api.github.com/users/vroad/orgs","repos_url":"https://api.github.com/users/vroad/repos","events_url":"https://api.github.com/users/vroad/events{/privacy}","received_events_url":"https://api.github.com/users/vroad/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-04T08:10:20Z","updated_at":"2016-12-30T00:06:03Z","closed_at":"2016-12-30T00:05:12Z","body":"This difference makes Starling v2 work differently on OpenFL. If you add another `CONTEXT3D_CREATE` listener inside an `CONTEXT3D_CREATE` listener like this, Context3D gets recreated right after first creation.\r\n\r\nhttps://github.com/Gamua/Starling-Framework/blob/62834683211b7928448e75c6ac6d02cac220e183/starling/src/starling/core/Starling.as#L582\r\n\r\nStarling's built-in event dispatcher avoids this problem like this.\r\n- create copy of Vector(listener list) when removeEventListener is called\r\n- save number of listeners before entering dispatch loop\r\n\r\nSo events are dispatched correctly even if you remove/add listeners in a listener.\r\n\r\nhttps://github.com/Gamua/Starling-Framework/blob/e81c1d869a3cc53ba518557c7fe59c634d34e649/starling/src/starling/events/EventDispatcher.as#L137-L139\r\n\r\nI'm not sure how `EventDispatcher` works on OpenFL. Why does it have 2 maps rather than 1 map?\r\nhttps://github.com/openfl/openfl/blob/e966c7237160579ced5a117764a7611a55a82f70/openfl/events/EventDispatcher.hx#L13-L14"},"comment":{"url":"https://api.github.com/repos/openfl/openfl/issues/comments/269713105","html_url":"https://github.com/openfl/openfl/issues/1369#issuecomment-269713105","issue_url":"https://api.github.com/repos/openfl/openfl/issues/1369","id":269713105,"user":{"login":"jgranick","id":833997,"avatar_url":"https://avatars.githubusercontent.com/u/833997?v=3","gravatar_id":"","url":"https://api.github.com/users/jgranick","html_url":"https://github.com/jgranick","followers_url":"https://api.github.com/users/jgranick/followers","following_url":"https://api.github.com/users/jgranick/following{/other_user}","gists_url":"https://api.github.com/users/jgranick/gists{/gist_id}","starred_url":"https://api.github.com/users/jgranick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgranick/subscriptions","organizations_url":"https://api.github.com/users/jgranick/orgs","repos_url":"https://api.github.com/users/jgranick/repos","events_url":"https://api.github.com/users/jgranick/events{/privacy}","received_events_url":"https://api.github.com/users/jgranick/received_events","type":"User","site_admin":false},"created_at":"2016-12-30T00:06:03Z","updated_at":"2016-12-30T00:06:03Z","body":"Recently, we went through a lot of test cases for event dispatching, with fixes. If you experience any specific issues with the current version that we can replicate in a small sample, let me know :smile:"}}
{"actor":{"display_login":"jgranick"}}