bug 378618. r=gavin. Added code to delete category entries when the component is unregistering itself

This commit is contained in:
mark.finkle@gmail.com 2007-04-28 17:05:55 -07:00
Родитель d8a7edfb37
Коммит 8dfae12727
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -685,9 +685,9 @@ var ApplicationModule = {
aCompMgr = aCompMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
aCompMgr.registerFactoryLocation(CLASS_ID, CLASS_NAME, CONTRACT_ID, aFileSpec, aLocation, aType);
// make the Update Service a startup observer
var categoryManager = Components.classes["@mozilla.org/categorymanager;1"]
.getService(Components.interfaces.nsICategoryManager);
// make Application a startup observer
categoryManager.addCategoryEntry("app-startup", CLASS_NAME, "service," + CONTRACT_ID, true, true);
// add Application as a global property for easy access
@ -698,6 +698,12 @@ var ApplicationModule = {
{
aCompMgr = aCompMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
aCompMgr.unregisterFactoryLocation(CLASS_ID, aLocation);
// cleanup categories
var categoryManager = Components.classes["@mozilla.org/categorymanager;1"]
.getService(Components.interfaces.nsICategoryManager);
categoryManager.deleteCategoryEntry("app-startup", "service," + CONTRACT_ID, true);
categoryManager.deleteCategoryEntry("JavaScript global property", CONTRACT_ID, true);
},
getClassObject: function am_gco(aCompMgr, aCID, aIID)