SIGN IN SIGN UP
angular / angular.js UNCLAIMED

AngularJS - HTML enhanced for web apps!

0 0 0 JavaScript

fix($rootScope): fix potential memory leak when removing scope listeners

Previously the array entry for listeners was set to null but the array size was
not trimmed until the event was broadcasted again (see e6966e05f508d1d2633b9ff327fea912b12555ac).

By keeping track of the listener iteration index globally it can be adjusted if
a listener removal effects the index.

Fixes #16135
Closes #16293

BREAKING CHANGE:

Recursively invoking `$emit` or `$broadcast` with the same event name is
no longer supported. This will now throw a `inevt` minErr.
J
Jason Bedard committed
817ac56719505680ac4c9997972e8f39eb40a6d0
Parent: 0864f73