Work around crash by using nsSupportsArray::Clone instead of the buggy (82133) nsSupportsArray::AppendElements. Patch from glazman@netscape.com, r=dbaron, sr=attinasi, b=80057
git-svn-id: svn://10.0.0.236/trunk@95685 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1345,12 +1345,9 @@ CSSStyleSheetImpl::CSSStyleSheetImpl(const CSSStyleSheetImpl& aCopy)
|
||||
|
||||
if (aCopy.mMedia) {
|
||||
nsCOMPtr<nsISupportsArray> tmp;
|
||||
NS_NewISupportsArray(getter_AddRefs(tmp));
|
||||
if (tmp) {
|
||||
tmp->AppendElements(NS_STATIC_CAST(nsISupportsArray *, aCopy.mMedia));
|
||||
mMedia = new DOMMediaListImpl(tmp, this);
|
||||
NS_IF_ADDREF(mMedia);
|
||||
}
|
||||
(NS_STATIC_CAST(nsISupportsArray *, aCopy.mMedia))->Clone(getter_AddRefs(tmp));
|
||||
mMedia = new DOMMediaListImpl(tmp, this);
|
||||
NS_IF_ADDREF(mMedia);
|
||||
}
|
||||
|
||||
if (aCopy.mFirstChild) {
|
||||
|
||||
@@ -1345,12 +1345,9 @@ CSSStyleSheetImpl::CSSStyleSheetImpl(const CSSStyleSheetImpl& aCopy)
|
||||
|
||||
if (aCopy.mMedia) {
|
||||
nsCOMPtr<nsISupportsArray> tmp;
|
||||
NS_NewISupportsArray(getter_AddRefs(tmp));
|
||||
if (tmp) {
|
||||
tmp->AppendElements(NS_STATIC_CAST(nsISupportsArray *, aCopy.mMedia));
|
||||
mMedia = new DOMMediaListImpl(tmp, this);
|
||||
NS_IF_ADDREF(mMedia);
|
||||
}
|
||||
(NS_STATIC_CAST(nsISupportsArray *, aCopy.mMedia))->Clone(getter_AddRefs(tmp));
|
||||
mMedia = new DOMMediaListImpl(tmp, this);
|
||||
NS_IF_ADDREF(mMedia);
|
||||
}
|
||||
|
||||
if (aCopy.mFirstChild) {
|
||||
|
||||
Reference in New Issue
Block a user