Skip to content

Commit

Permalink
imp - Fixed infinite loop of method adding
Browse files Browse the repository at this point in the history
---

In the inter-addon and inter-mod communication, we've fixed populating a
list of callable functions. This makes sure that we never enter into a
state of infinite looping caused by checking the wrong variable.

---

Type: imp
Breaking: False
Doc Required: False
Backport Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Dec 31, 2024
1 parent 74f0874 commit 975edf6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion public/Nitrocid/Kernel/Extensions/InterAddonTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public static Dictionary<string, MethodInfo> ListAvailableFunctions(string addon

// Make sure that overloaded methods that have the same name don't conflict with another method
int iter = 1;
while (functions.ContainsKey(name))
while (functions.ContainsKey(finalName))
{
iter++;
finalName = name + iter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public static Dictionary<string, MethodInfo> ListAvailableFunctions(string modNa

// Make sure that overloaded methods that have the same name don't conflict with another method
int iter = 1;
while (functions.ContainsKey(name))
while (functions.ContainsKey(finalName))
{
iter++;
finalName = name + iter;
Expand Down

0 comments on commit 975edf6

Please sign in to comment.