Kyle wrote:
I'm looking for a clean way to detect when the aplication is closing,
so I can fire an event. It seems that nsIShutdownListener no longer
exists, so I'm looking for an approach that will achieve a similar
result. Thanks,

-- Kyle

XPCOM does fire a shutdown event. I am not sure if this event is too late in application shutdown for you. In order to process this event, you must register with the nsIObserverService:


// ignoring errors
nsCOMPtr<nsIObserverService> observerService(do_GetService("@mozilla.org/observer-service;1", &rv));


rv = observerService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, PR_TRUE);

|this| must implement the nsIObserver interface. You can find many examples of this in lxr.

Regards,
Doug
_______________________________________________
Mozilla-xpcom mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to