зеркало из https://github.com/mozilla/pjs.git
This could leave you with a dangling pointer:
nsCStringKey key(nsPromiseFlatCString(aRef).get()); because the nsPromiseFlatCString object will go out of scope, so do this instead: nsPromiseFlatCString flat(aRef); nsCStringKey key(flat.get()); sr=scc
This commit is contained in:
Родитель
5c5de15b33
Коммит
42cb1adf93
|
@ -160,7 +160,8 @@ nsXBLDocumentInfo::GetPrototypeBinding(const nsAReadableCString& aRef, nsIXBLPro
|
|||
if (!mBindingTable)
|
||||
return NS_OK;
|
||||
|
||||
nsCStringKey key(nsPromiseFlatCString(aRef).get());
|
||||
nsPromiseFlatCString flat(aRef);
|
||||
nsCStringKey key(flat.get());
|
||||
*aResult = NS_STATIC_CAST(nsIXBLPrototypeBinding*, mBindingTable->Get(&key)); // Addref happens here.
|
||||
|
||||
return NS_OK;
|
||||
|
@ -172,7 +173,8 @@ nsXBLDocumentInfo::SetPrototypeBinding(const nsAReadableCString& aRef, nsIXBLPro
|
|||
if (!mBindingTable)
|
||||
mBindingTable = new nsSupportsHashtable();
|
||||
|
||||
nsCStringKey key(nsPromiseFlatCString(aRef).get());
|
||||
nsPromiseFlatCString flat(aRef);
|
||||
nsCStringKey key(flat.get());
|
||||
mBindingTable->Put(&key, aBinding);
|
||||
|
||||
return NS_OK;
|
||||
|
|
Загрузка…
Ссылка в новой задаче