DoclerLabs / hexMachina

Releases, issues, documentation, website of hexMachina, framework written in Haxe
http://hexmachina.org
MIT License
44 stars 8 forks source link

Crash when dispatch is called on sealed Dispatcher #221

Closed aliokan closed 7 years ago

aliokan commented 7 years ago

Call dispatch on Dispatcher with _isSealed = true;, result an unended loops call.

Uncaught RangeError: Maximum call stack size exceeded

As we can see, if _isSealed == true when dispatch is called, we add call to this._cachedMethodCalls Dispatcher.hx#L86 And later, when _isSealed change to false, we check if some calls are saved in this._cachedMethodCalls. Dispatcher.hx#L326

The problem is this._cachedMethodCalls couldn't be reset Dispatcher.hx#L333, because each time this._isSealed is switched from true to false at the end of the call Dispatcher.hx#L82 and re-run the dispatch();