View Single Post
09/02/15, 12:50 PM   #27
Wandamey
Guest
Posts: n/a
Originally Posted by merlight View Post
You just need to avoid creating a thousand closures. Once you do that, you will notice that your code doesn't need to call SetHandler a thousand times, because all the calls would be identical. Aim for removing unnecessary closures. Set the handler once after constructing the control.

If you need something more complex, like switching an OnUpdate handler on when resizing and off when it's done, you naturally do have to call SetHandler multiple times, but chances are you don't need to create multiple closures.
thing is i get it overall, but when i look at my plugin for someone else's addon, there are a lot of things I can't control. But i'll figure out something. Just hoping it won't be worse after from another point of view than this particular problem.
  Reply With Quote