Quantcast WoWInterface - View Single Post - My favourite addon leaks memory
View Single Post
07-08-19, 11:29 AM   #19
DashingSplash
A Murloc Raider
Join Date: Jun 2019
Posts: 7
I got a bit intrigued by the table wipe discussion since I used it for my first AddOn that I made (or rather an early version of my first AddOn). Since I had trouble with the tables keeping their old values when the UPDATE_BINDINGS event was triggered I had to wipe the tables as shown below.

Lua Code:
  1. local table_1 = {t = {}, st = {}, ct = {}, at = {}} --Filled after dashingUpdate has executed
  2. local table_2 = {t2 = {}, st2 = {}, ct2 = {}, at2 = {}} --Filled after dashingUpdate has executed
  3.  
  4. local function dashingUpdate(self, event, ...)
  5.     for _, tableWipe in pairs(table_1) do
  6.         wipe(tableWipe)
  7.     end
  8.    
  9.     for _, tableWipe in pairs(table_2) do
  10.         wipe(tableWipe)
  11.     end
  12. end

Would this actually be an OK way to do it, or would I get problems if the addon had been updating a lot more?
  Reply With Quote