Bug 1445584 - add a move assignment operator for nsCOMPtr; r=gerald

Somehow we didn't have this before.  The lack thereof was causing us to
do unnecessary things during event dispatch.
This commit is contained in:
Nathan Froyd 2018-03-14 08:22:30 -04:00
parent 6b346fbdd8
commit 075adc9ec6

View File

@ -619,6 +619,13 @@ public:
return *this;
}
nsCOMPtr<T>& operator=(nsCOMPtr<T>&& aRhs)
{
assign_assuming_AddRef(aRhs.forget().take());
NSCAP_ASSERT_NO_QUERY_NEEDED();
return *this;
}
nsCOMPtr<T>& operator=(T* aRhs)
{
assign_with_AddRef(aRhs);