You are here

Battle Memory Leaks, and Elusive Leaks

Hey Folks! Work continues on the memory leak patches today.

Tiago found some bugs in the memory leak patch I added that caused battles to have null pointers. He was able to prevent the errors, but it was tricky to sort out which items belonged to the battle vs. regular encounter items. So we plugged away at it a bit, and were finally able to sort them out using the data handler class. Basically, there is one of each battle move in memory that all battles share, so we had to be careful not to delete them prematurely. But also make sure we deleted them when done.

Once that was fixed, I started looking into the remaining items. And things are getting harder to pin down here. Seemingly random items are getting missed on clean-up after a game closes, and no amount of my investigating has been able to find the smoking gun. It almost seems like AI standard loadouts and hex items are to blame, but I can't see why. And I can't prove that it's happening.

I'll probably look at this a bit more tomorrow, but if it's too hard, I might just chalk it up to "good enough" and move on. Tiago says most of the memory leak is plugged after the weekend's changes, so we may be at a point of diminishing returns.

That's all for today. Have a good one, all!