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;
|
||||
}
|
||||
|
||||
template <typename I>
|
||||
void
|
||||
forget( T** rhs )
|
||||
forget( I** rhs)
|
||||
// Set the target of rhs to the value of mRawPtr and null out mRawPtr.
|
||||
// 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!");
|
||||
*rhs = 0;
|
||||
swap(*rhs);
|
||||
*rhs = mRawPtr;
|
||||
mRawPtr = 0;
|
||||
}
|
||||
|
||||
T*
|
||||
|
Loading…
Reference in New Issue
Block a user