Closed Bug 1275229 Opened 3 years ago Closed 3 years ago
Stop using do
_Create Instance("@mozilla .org/image/loader;1") to create gecko internal img Loader instances
imgLoader currently uses do_CreateInstance("@mozilla.org/image/loader;1") to create imgLoader instances because it needs its XPCOM module to be initialized before imgLoader instances are created or used, and do_CreateInstance takes care of that. That's silly though. We can just initialize the module ourselves which is more efficient, less confusing, and clears the way to getting rid of "@mozilla.org/image/loader;1" and "@mozilla.org/image/cache;1".
FWIW I built without the module initialization to see what breaks. The first thing to break is the sMemReporter->AddRef() call in the imgLoader constructor, since sMemReporter is created during the module initialization step. That was tricky to figure out though because the errors on Try were really opaque (hence why I think this is worth a comment for anyone doing bug archeology in the future). https://treeherder.mozilla.org/#/jobs?repo=try&revision=c3686b389285&selectedJob=21300550
Attachment #8755799 - Flags: review?(tnikkel) → review+
You need to log in before you can comment on or make changes to this bug.