Closed jetrotal closed 6 months ago
This looks quite complex. Can you attach a testcase?
While you are at it also add one to the string split issue.
I do not have all this patch stuff (and especially TPC) setup on all devices. Is faster for me when you provide something executable.
I have no idea right now why the memory is not freed. This uses the same code we use everywhere else for creating Bitmaps.
Makes me wonder now if we have an undetected memleak here in general...
@jetrotal the deletion fails for Picture ID 2 and ID 7.
Are you doing anything different in the Show String Picture commands of 2 and 7 compared to the rest?
I guess, I managed to track it down. If I delete all the events that uses variables for "size". It stops the leak...
While doing some tests, I noticed an constant increase in memory usage on a command that simply asigned variables and created string pictures:![image](https://github.com/EasyRPG/Player/assets/45118493/529de9a7-b951-464d-91b8-7ecaa7c0fb16)
Maybe the issue was caused by the repeated usage of Show string pictures, reseting the same pictures over and over again.![image](https://github.com/EasyRPG/Player/assets/45118493/235b9fc2-ed9f-4cd7-a50e-f735d0857086)
I suspect the same issue can happen on the original rpg_rt and patches. To mitigate that, I suggest Avoid doing all the steps from commands like "Show Picture", "Show String Picture" and "Move Picture", If the result turns to be the exact same as it was before.
In case of move picture, maybe the command should just wait until the amount of frames it's marked to use.