Skip to content

Commit

Permalink
Bug 1672072 - P12. Add constructor for WeakPtr(RefPtr). r=sg
Browse files Browse the repository at this point in the history
This allows for nice template type deducation.

Differential Revision: https://phabricator.services.mozilla.com/D96368
  • Loading branch information
Jean-Yves Avenard committed Nov 12, 2020
1 parent b3d07be commit b5d82b7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mfbt/WeakPtr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {}

Expand Down

0 comments on commit b5d82b7

Please sign in to comment.