alexguirre / RAGENativeUI

MIT License
115 stars 38 forks source link

Change MenuPool.Process to not use foreach in case menu gets added #50

Closed pnwparksfan closed 4 years ago

pnwparksfan commented 4 years ago

https://github.com/alexguirre/RAGENativeUI/blob/master/Source/MenuPool.cs#L148

MenuPool.Process (and the related process functions it calls) use foreach loops. This means that if a menu has an event handler which itself adds/removes menus, you will get a System.InvalidOperationException for modifying an enumerable while in a foreach loop.

Instead, consider using a for loop, or doing a foreach on InternalList.ToArray()