My favourite addon leaks memory
View Single Post
07-06-19, 06:05 PM
An Onyxian Warder
Join Date: Apr 2007
That's just Lua. When you create a new table and assign it to that key, the previous table, despite being empty, still exists. It's just unobtainable, floating in memory, until it gets released by garbage collection. This has been a known issue for years. Blizzard relatively recently developed "table pools" where they reuse tables, even empty tables.
Instead of assigning a new empty table to an object that already has a table, use wipe() instead. If your desired effect is to just make sure the object is a table, use type() before assigning it a table.
Lua Wall of Shame
Don't like combat text on frames?
View Public Profile
Send a private message to Kanegasi
Find More Posts by Kanegasi