зеркало из https://github.com/mozilla/gecko-dev.git
Bug 392493 - "Add forget() method to nsCOMPtr and nsRefPtr". r=dbaron, a=bzbarsky.
This commit is contained in:
Родитель
c5feb257f8
Коммит
dca0f40dcc
|
@ -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
|
||||
/*
|
||||
|
|
Загрузка…
Ссылка в новой задаче