Fix EventHandlerList move assignment

This commit is contained in:
pixl 2023-05-01 22:40:37 -04:00
parent 47e4ba2b44
commit 1ff386a4bf
No known key found for this signature in database
GPG Key ID: 1866C148CD593B6E

View File

@ -67,9 +67,16 @@ public:
EventHandlerLock& operator=(const EventHandlerLock&) = delete;
EventHandlerLock& operator=(EventHandlerLock&& o) noexcept {
this->_list = o._list;
this->_iterator = o._iterator;
o._list.reset();
if (this != &o) {
if (auto list = _list.lock()) {
this->_list.reset();
list->remove(_iterator);
}
this->_list = o._list;
o._list.reset();
this->_iterator = o._iterator;
}
return *this;
}