Bug 1017941 - Initialize loop during delayedStartup() to avoid observer leaks. r=Unfocused

This commit is contained in:
Mark Hammond 2014-05-30 12:19:41 +10:00
parent ea400da715
commit 365f799d7d
2 changed files with 8 additions and 12 deletions

View File

@ -57,20 +57,12 @@ XPCOMUtils.defineLazyModuleGetter(this, "MozLoopService", "resource:///modules/l
},
/**
* Triggers the initialization of the loop service after startup has finished.
* Triggers the initialization of the loop service. Called by
* delayedStartup.
*/
initialize: function() {
var observer = function observer(sbject, topic, data) {
if (topic == "browser-delayed-startup-finished") {
Services.obs.removeObserver(observer, "browser-delayed-startup-finished");
MozLoopService.initialize();
}
};
Services.obs.addObserver(observer,
"browser-delayed-startup-finished", false);
}
MozLoopService.initialize();
},
};
LoopUI.initialize();
})();

View File

@ -1185,6 +1185,10 @@ var gBrowserInit = {
gDataNotificationInfoBar.init();
#endif
#ifdef MOZ_LOOP
LoopUI.initialize();
#endif
gBrowserThumbnails.init();
// Add Devtools menuitems and listeners