UOOutlands / Razor

Razor is a free tool designed to help with simple tasks while playing Ultima Online.
http://www.uor-razor.com
GNU General Public License v3.0
9 stars 6 forks source link

Fixed exception where enumerator was modified while enumerating, leading to InvalidOperationException #87

Closed Tranq1 closed 2 years ago

Tranq1 commented 2 years ago

Bug reproduction:

  1. Create a fresh ClassicUO/Razor install
  2. Use the default profile
  3. Add one or more script variables

Reason for crash/exception:

When loading the config, razor would create a default profile, razor would load the variables and then call ScriptVariables.ClearAll(). This would lead to the ClearAll method iterating over _variables, calling UnregisterVariable(), which in turn would remove the variable from the _variables dictionary. This then lead to an InvalidOperationException.

This bug could be the reason so many people have experienced problems with razor not starting anymore after some time of using it when they first added a script variable.

image