mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 489705 - nsRefPtr should be able to forget a base class to a pure virtual interface it inherits from
r=bsmedberg sr=dbaron
This commit is contained in:
parent
6cd1ca156d
commit
46166ad09a
@ -1042,15 +1042,17 @@ class nsRefPtr
|
|||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename I>
|
||||||
void
|
void
|
||||||
forget( T** rhs )
|
forget( I** rhs)
|
||||||
// Set the target of rhs to the value of mRawPtr and null out mRawPtr.
|
// Set the target of rhs to the value of mRawPtr and null out mRawPtr.
|
||||||
// Useful to avoid unnecessary AddRef/Release pairs with "out"
|
// Useful to avoid unnecessary AddRef/Release pairs with "out"
|
||||||
// parameters.
|
// parameters where rhs bay be a T** or an I** where I is a base class
|
||||||
|
// of T.
|
||||||
{
|
{
|
||||||
NS_ASSERTION(rhs, "Null pointer passed to forget!");
|
NS_ASSERTION(rhs, "Null pointer passed to forget!");
|
||||||
*rhs = 0;
|
*rhs = mRawPtr;
|
||||||
swap(*rhs);
|
mRawPtr = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
T*
|
T*
|
||||||
|
Loading…
Reference in New Issue
Block a user