Matthew Wilson wrote:

Is there a memory leak caused by calling addObserver but never removeObserver?

Sorry for not reading your code, but it's faster for me to explain the three cases and let you work out which one applies: If you store the observer service in a global then as I recall you may leak anyway; I can dig out the details if you like. If you add a strong observer obs.addObserver(topic, callback, false); then it will leak the window until you remove it. If your observer is correctly written then you can add it as a weak observer obs.addObserver(topic, callback, true); in which case the most it will leak is the weak reference which is comparatively tiny. I can't remember if the weak reference is automatically removed when the topic is next observed.
_______________________________________________
Project_owners mailing list
[email protected]
http://mozdev.org/mailman/listinfo/project_owners

Reply via email to