webPreferencesInstances does not keep a reference to all the instances it holds. So if you call WebPreferences::initWithIdentifier() to make a WebPreferences object and then release it, the hashmap still holds a stale pointer to that instance, and next time initWithIdentifier() is called again with the same identifier, it'll return the stale object.
Created attachment 24270 [details] Patch
Comment on attachment 24270 [details] Patch 3 https://bugs.webkit.org/show_bug.cgi?id=21526 We normally put the title of the bug in the ChangeLog as well. 619 preferences = 0; 620 if (identifier) { 621 WebPreferences::removeReferenceForIdentifier(identifier); 622 SysFreeString(identifier); 623 } It might be worth adding a comment here about why we release preferences first. r=me
Will address feedback from aroben
Fixed in r37489