On 5/16/2013 8:12 PM, Ehsan Akhgari wrote:
A dependency system for startup/shutdown isn't free. It's going to have runtime cost, and it's going to make the code more complicated. Given the fact that we've managed to get by just fine without one for years, I think we should continue to do that, and in the cases where you want specific ordering, just use hard-coded notifications (such as profile-before-change2 -- BTW, that's a terrible name!).
As I understand, the original problem is that we instantiate a service for the first time "too late". It then is not able to shut it self down using "xpcom-shutodown" notification, since it has been created from "xpcom-shutodown" call.

IMO, enough would be to have XPCOM bool isAfterShutdown() flag somewhere. Services that depends on xpcom-shutdown notification would check for this flag and refuse to instantiate or init.

Could also be integrated in the generic constructor somehow - constructors would express that instantiation may not happen after certain events of xpcom.

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

Reply via email to