# HG changeset patch # User aceman # Date 1512283380 -3600 # Node ID b38e2320eddafb839458a962e55c381a9dce1848 # Parent 9c0b9e531cce3d67dd9d7844595fa0329b7563b3 Bug 1401528 - fix unregistering factories in calBackendLoader.js. r=philipp diff --git a/calendar/base/backend/calBackendLoader.js b/calendar/base/backend/calBackendLoader.js --- a/calendar/base/backend/calBackendLoader.js +++ b/calendar/base/backend/calBackendLoader.js @@ -45,35 +45,33 @@ calBackendLoader.prototype = { "@mozilla.org/calendar/ics-service;1", "@mozilla.org/calendar/period;1", "@mozilla.org/calendar/recurrence-rule;1" ]; // Unregister libical components let registrar = Components.manager.QueryInterface(Components.interfaces.nsIComponentRegistrar); for (let contractId of contracts) { - let classobj = Components.classes[contractId]; - let factory = Components.manager.getClassObject(classobj, Components.interfaces.nsIFactory); let classId = registrar.contractIDToCID(contractId); + let factory = Components.manager.getClassObject(classId, Components.interfaces.nsIFactory); registrar.unregisterFactory(classId, factory); } // Now load ical.js backend let uri = Services.io.getProtocolHandler("resource") .QueryInterface(Components.interfaces.nsIResProtocolHandler) .getSubstitution("calendar"); let file = Services.io.getProtocolHandler("file") .QueryInterface(Components.interfaces.nsIFileProtocolHandler) .getFileFromURLSpec(uri.spec); file.append("components"); file.append("icaljs-manifest"); - Components.manager.QueryInterface(Components.interfaces.nsIComponentRegistrar) - .autoRegister(file); + registrar.autoRegister(file); dump("[calBackendLoader] Using icaljs backend at " + file.path + "\n"); } else { dump("[calBackendLoader] Using Thunderbird's builtin libical backend\n"); } this.loaded = true; } };