RAProject64 runs the overlay message loop on a different thread than the achievement processing code, so there's a chance of a conflict between the achievement processing code modifying the UI elements and the UI drawing them.
Using an example provided by another user, attempting to display three challenge indicators in the same frame was crashing RAProject64. The achievement processing code was trying to add the second (or third) indicator to the UI while the UI was looping through the collection to display the first (and sometimes second). Modifying the collection while it was being processed would cause an access violation exception which would terminate the application.
The solution is to add critical sections to the code. I've made rendering the overlay a critical section and paired it with any code that adds or removes elements to the overlay. This fixes the example above with the three challenge indicators.
RAProject64 runs the overlay message loop on a different thread than the achievement processing code, so there's a chance of a conflict between the achievement processing code modifying the UI elements and the UI drawing them.
Using an example provided by another user, attempting to display three challenge indicators in the same frame was crashing RAProject64. The achievement processing code was trying to add the second (or third) indicator to the UI while the UI was looping through the collection to display the first (and sometimes second). Modifying the collection while it was being processed would cause an access violation exception which would terminate the application.
The solution is to add critical sections to the code. I've made rendering the overlay a critical section and paired it with any code that adds or removes elements to the overlay. This fixes the example above with the three challenge indicators.