BrowserApp does not properly clean up on shutdown




5 years ago
3 years ago


(Reporter: mcomella, Unassigned)



Firefox Tracking Flags

(Not tracked)


Notably the observers registered in BrowserApp.startup(...) [1] are missing from BrowserApp.shutdown(...) [2].


mbrubeck said we may be able to pass ownsWeak=true to addObserver, rather than making many removeObserver calls.

There may be other things that we're not cleaning up properly so it may be worth investigating further for BrowserApp (and other systems), particularly becouse, as nalexander puts it: "Understanding these lifecycles is hard, and changing as we add background services, rework our activity flow, and implement geckoview."
I'm not against the cleanup, but I think part of the reason we see the disconnect is: What bad things will happen if we miss shutdown?
* We are closing the window, and presumably the app
* Android will likely kill us without ever getting to shutdown

It's true this could become a different story in the future. I might predict that adding the ability to use multiple GeckoViews in an app would mean multiple browser.js windows being created. In this case, we might see a benefit from having proper cleanup.
Something worth tracking?
You need to log in before you can comment on or make changes to this bug.