cseelhoff / RimThreaded

RimThreaded is a RimWorld mod designed to enable RimWorld to utilize multiple threads.
MIT License
117 stars 21 forks source link

Fix Reservation manager concurrent access #655

Closed brustmopf closed 2 years ago

brustmopf commented 3 years ago

should also fix Issue #652

Sernior commented 3 years ago

You are missing SimplePool_Patch.Return methods causing a memory leak each time a reservation is created. Each release method needs a Return. Also Issue #652 is unrelated to this. Issue #652 is fixed by making RimWorld.JobDriver_RopeToDestination.tmpRopees Threadstatic using replacements.json.

brustmopf commented 3 years ago

HI Sernior.

Thank you for catching that. I added the return on Reservation in the latest commits for all release methods.

Should fix that memory leak.

You are correct, I seem to be referencing the wrong issue ( I had one with concurrent access modifications from reservation manager, but can't seem to find it) The issue definitely still stands though ( I encountered it myself with rimfactory for example.

brustmopf commented 3 years ago

And I also corrected the missing switch to a read write lock at line 178.

Many thanks for your watchful eye :-)