View Single Post
Old 01-07-13, 03:58 PM   #5
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 3,986
Originally Posted by laukond View Post
Is there a way to rewrite the code so it does not update the FPS, ping, and memory all the time when hovering the TrackButton?
Yes, and I already told you how:

Originally Posted by Phanx View Post
If you're seeing your tooltip addon occupy increasing amounts of memory, it's probably because you're generating a new table on every update, which is very expensive and wasteful. You should only create the "topAddOns" table once, outside of the "UpdateTooltip" method. Since the number of table entries (NUM_ADDONS_TO_DISPLAY) never changes you don't even need to clear the table between uses; you can just overwrite the values like you're already doing.
The code SDPhantom posted includes a number of other improvements/optimizations, so you should probably just use that, but you could solve the specific problem you asked about by making the one specific change I suggested (moving the "topAddOns" table creation outside of the "UpdateTooltip" method).
__________________
Author/maintainer of Grid, PhanxChat, ShieldsUp, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
Phanx is offline   Reply With Quote