On 2/17/2014 2:25 PM, Kyle Huey wrote:
If you are observing several topics it's easy to forget to add a
Remove call when adding new observer topic.  If you instead write an
array of topics and iterate over that it's impossible to screw up
(e.g. https://hg.mozilla.org/mozilla-central/rev/3a8fe7c942e3).  We've
seen a couple of leaks caused by forgetting to remove all observers
(e.g. https://bugzilla.mozilla.org/show_bug.cgi?id=968536#c0).

Would it be worth adding an AddObservers()/RemoveObservers() API that takes an array directly? That might encourage this pattern.

Just a thought.

Ben
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to