mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 20:05:49 +00:00
Bug 434163. Make sure to not let our hashtable mutate while we're iterating it. r+sr=jst
This commit is contained in:
parent
7e9f44d6b6
commit
62d86670f2
@ -1800,6 +1800,11 @@ NPObjWrapperPluginDestroyedCallback(PLDHashTable *table, PLDHashEntryHdr *hdr,
|
||||
NppAndCx *nppcx = reinterpret_cast<NppAndCx *>(arg);
|
||||
|
||||
if (entry->mNpp == nppcx->npp) {
|
||||
// Prevent invalidate() and deallocate() from touching the hash
|
||||
// we're enumerating.
|
||||
const PLDHashTableOps *ops = table->ops;
|
||||
table->ops = nsnull;
|
||||
|
||||
NPObject *npobj = entry->mNPObj;
|
||||
|
||||
if (npobj->_class && npobj->_class->invalidate) {
|
||||
@ -1816,6 +1821,8 @@ NPObjWrapperPluginDestroyedCallback(PLDHashTable *table, PLDHashEntryHdr *hdr,
|
||||
|
||||
::JS_SetPrivate(nppcx->cx, entry->mJSObj, nsnull);
|
||||
|
||||
table->ops = ops;
|
||||
|
||||
return PL_DHASH_REMOVE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user