OnionUI / Onion

OS overhaul for Miyoo Mini and Mini+
https://onionui.github.io
GNU General Public License v3.0
3.46k stars 215 forks source link

Fix memory leaks with cJSON #1653

Closed MattCatz closed 2 months ago

MattCatz commented 3 months ago

cJSON structures need to be deleted rather than free-ed so all sub-structures are cleaned up.

I don't think this was causing any major leaks but should now be causing no leaks :D.

See: https://github.com/OnionUI/Onion/blob/7dfc008b851398dcfe57819519efe5f958c77f65/include/cjson/cJSON.h#L146

MattCatz commented 2 months ago

You learn something every day.. did you compile and test this?

I have compiled and run this. I cherry-picked this form between some other patches so let me know if it doesn't apply correctly.