зеркало из https://github.com/mozilla/pjs.git
Bug 392493 - "Add forget() method to nsCOMPtr and nsRefPtr". r=dbaron, a=bzbarsky.
This commit is contained in:
Родитель
61c17bed9b
Коммит
b4fa7a162c
|
@ -1032,6 +1032,16 @@ class nsRefPtr
|
|||
mRawPtr = temp;
|
||||
}
|
||||
|
||||
already_AddRefed<T>
|
||||
forget()
|
||||
// return the value of mRawPtr and null out mRawPtr. Useful for
|
||||
// already_AddRefed return values.
|
||||
{
|
||||
T* temp = 0;
|
||||
swap(temp);
|
||||
return temp;
|
||||
}
|
||||
|
||||
T*
|
||||
get() const
|
||||
/*
|
||||
|
|
|
@ -819,6 +819,16 @@ class nsCOMPtr
|
|||
|
||||
// Other pointer operators
|
||||
|
||||
already_AddRefed<T>
|
||||
forget()
|
||||
// return the value of mRawPtr and null out mRawPtr. Useful for
|
||||
// already_AddRefed return values.
|
||||
{
|
||||
T* temp = 0;
|
||||
swap(temp);
|
||||
return temp;
|
||||
}
|
||||
|
||||
T*
|
||||
get() const
|
||||
/*
|
||||
|
|
Загрузка…
Ссылка в новой задаче