mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Bug 316569, Memory leak in XTF when using nsXTFInterfaceAggregator, r+sr=bryner
This commit is contained in:
parent
f2d4eacd78
commit
a41b6a076e
@ -208,14 +208,16 @@ nsXTFBindableElementWrapper::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
// try to get get the interface from our wrapped element:
|
||||
void *innerPtr = nsnull;
|
||||
QueryInterfaceInner(aIID, &innerPtr);
|
||||
nsCOMPtr<nsISupports> inner;
|
||||
QueryInterfaceInner(aIID, getter_AddRefs(inner));
|
||||
|
||||
if (innerPtr)
|
||||
return NS_NewXTFInterfaceAggregator(aIID,
|
||||
NS_STATIC_CAST(nsISupports*, innerPtr),
|
||||
NS_STATIC_CAST(nsIContent*, this),
|
||||
aInstancePtr);
|
||||
if (inner) {
|
||||
rv = NS_NewXTFInterfaceAggregator(aIID, inner,
|
||||
NS_STATIC_CAST(nsIContent*, this),
|
||||
aInstancePtr);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
return NS_ERROR_NO_INTERFACE;
|
||||
}
|
||||
|
@ -102,14 +102,16 @@ nsXTFElementWrapper::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
}
|
||||
else {
|
||||
// try to get get the interface from our wrapped element:
|
||||
void *innerPtr = nsnull;
|
||||
QueryInterfaceInner(aIID, &innerPtr);
|
||||
nsCOMPtr<nsISupports> inner;
|
||||
QueryInterfaceInner(aIID, getter_AddRefs(inner));
|
||||
|
||||
if (innerPtr)
|
||||
return NS_NewXTFInterfaceAggregator(aIID,
|
||||
NS_STATIC_CAST(nsISupports*, innerPtr),
|
||||
NS_STATIC_CAST(nsIContent*, this),
|
||||
aInstancePtr);
|
||||
if (inner) {
|
||||
rv = NS_NewXTFInterfaceAggregator(aIID, inner,
|
||||
NS_STATIC_CAST(nsIContent*, this),
|
||||
aInstancePtr);
|
||||
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
return NS_ERROR_NO_INTERFACE;
|
||||
|
Loading…
Reference in New Issue
Block a user