Created attachment 633489 [details] [diff] [review]
When given a page that isn't in the list of registered pages, NewTabUtils.allPages.unregister() will still remove a page because it doesn't check if indexOf() > -1.
Comment on attachment 633489 [details] [diff] [review]
How'd you find this? Presumably in practice unregister never gets called for pages that haven't been registered?
(In reply to :Gavin Sharp (use firstname.lastname@example.org for email) from comment #1)
> How'd you find this? Presumably in practice unregister never gets called for
> pages that haven't been registered?
Right, while working on bug 753448 I noticed that the preloaded about:newtab instances were out of sync because they weren't tracked anymore. This happens because of how we use registerCleanupFunction() here to make sure the dummy page gets removed when timing out: