forked from mirrors/gecko-dev
Bug 1672072 - P12. Add constructor for WeakPtr(RefPtr). r=sg
This allows for nice template type deducation. Differential Revision: https://phabricator.services.mozilla.com/D96368
This commit is contained in:
parent
6fcaf876b9
commit
1b9b84bbce
1 changed files with 2 additions and 0 deletions
|
|
@ -294,6 +294,8 @@ class WeakPtr {
|
|||
#endif
|
||||
}
|
||||
|
||||
explicit WeakPtr(const RefPtr<T>& aOther) : WeakPtr(aOther.get()) {}
|
||||
|
||||
// Ensure that mRef is dereferenceable in the uninitialized state.
|
||||
WeakPtr() : mRef(new WeakReference(nullptr)) {}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue