Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    When object is destroyed where are its observe registrations removed?

    Hi,
    I have a case where a canvas observes a method call on another object. The canvas gets destroyed (that's okay) but the observe registration still seems to be there.

    I tried to find in the smartclient code where the observations are removed when an object gets destroyed (should happen when the observed as well as the observer get destroyed).

    Where in the smartclient code can I find this? So that i can debug further what I am doing wrong.

    gr. Martin

    #2
    Actually cleaning up observations applied via class.observe(...) is not automatic on destroy() - you can use class.ignore(...) to clear up an observation yourself.
    We may make this automatic in the future (possibly as part of the 4.0 release).

    Comment


      #3
      Okay thanks for your reply, it is maybe good to mention this in the docs...

      Afaics this not-automatic-ignore gives a high risk for memory leaks and unexpected behavior. It is quite easy to forget to deregister in destroy and it is quite logical to do this at a higher level (in the root object in the hierarchy), so some developers will probably expect this to be handled by Smartclient (at least I did...).

      gr. Martin
      Last edited by martintaal; 25 Oct 2012, 23:57.

      Comment

      Working...
      X