Quantcast
WoWInterface - View Single Post - Memory Leak ?
Thread: Memory Leak ?
View Single Post
05-04-17, 12:56 PM   #9
MunkDev
A Scalebane Royal Guard
 
MunkDev's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 428
Lua Code:
  1. local LE_FOLLOWER_TYPE_GARRISON_7_0 = LE_FOLLOWER_TYPE_GARRISON_7_0
  2. local GetAvailableMissions = C_Garrison.GetAvailableMissions
  3. local GetInProgressMissions = C_Garrison.GetInProgressMissions
  4. local GetCompleteMissions = C_Garrison.GetCompleteMissions
  5. local mis_avl, mis_pro, mis_fin
  6.  
  7. local frame = CreateFrame('Frame')
  8. frame:RegisterEvent('GARRISON_UPDATE')
  9. frame:SetScript('OnEvent', function()
  10.     local avl = GetAvailableMissions(LE_FOLLOWER_TYPE_GARRISON_7_0)
  11.     local pro = GetInProgressMissions(LE_FOLLOWER_TYPE_GARRISON_7_0)
  12.     local fin = GetCompleteMissions(LE_FOLLOWER_TYPE_GARRISON_7_0)
  13.  
  14.     mis_avl = avl and #avl or 0
  15.     mis_pro = pro and #pro or 0
  16.     mis_fin = fin and #fin or 0
  17. end)
  18.  
  19. function dataobj.OnTooltipShow(tooltip)
  20.     -- [ blabla ]
  21.  
  22.     -- use mis_avl, mis_pro, mis_fin here
  23.  
  24.      -- [ blabla ]
  25. end
__________________
  Reply With Quote