View Single Post
11-22-15, 01:07 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Yes, functions are garbage-collected. The only things that aren't are frames.

However, if your actual code is anything like your fake example code (seriously, why do you people post this crap? just post your real code ) then you should just assign your "anonymous" function to a variable so you can reuse it instead of creating endless duplicates of it, or better yet, don't bother caching the right position at all; if you actually need to determine the right position of a frame so often that just calling frame:GetRight() is slowing things down and caching offers a meaningful benefit, there's probably a more fundamental flaw with your program design.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote