Author Topic: UIScrollBar delegate unsubscribe?  (Read 2248 times)

getluky

  • Guest
UIScrollBar delegate unsubscribe?
« on: September 23, 2012, 12:44:55 PM »
Not sure if this is a bug (or perhaps you just know more than me), but although UIScrollBar subscribes to some UIEventListener events in Start(), it doesn't seem to unsubscribe in OnDestroy. I've been trained (by Prime31's plugins) to always balance subscribe/unsubscribe to events to avoid leaking objects between scenes, so I wanted to bring this up and ask if this is omitted intentionally, or is it a bug?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIScrollBar delegate unsubscribe?
« Reply #1 on: September 23, 2012, 05:54:19 PM »
It subscribes to the events of child objects. Child objects aren't going to go anywhere. If a scene changes, everything gets removed anyway -- both the child objects, and the script you're concerned about, so this isn't an issue.

getluky

  • Guest
Re: UIScrollBar delegate unsubscribe?
« Reply #2 on: September 23, 2012, 11:34:55 PM »
Ah, that makes sense. Thank you for taking the time to help me understand!