diff --git a/src/impl/node/weak_realm_notifier.cpp b/src/impl/node/weak_realm_notifier.cpp index 11dff78d..d0d2d58a 100644 --- a/src/impl/node/weak_realm_notifier.cpp +++ b/src/impl/node/weak_realm_notifier.cpp @@ -17,6 +17,7 @@ //////////////////////////////////////////////////////////////////////////// #include +#include #include "impl/weak_realm_notifier.hpp" @@ -46,6 +47,7 @@ WeakRealmNotifier::WeakRealmNotifier(const std::shared_ptr& realm, bool c WeakRealmNotifier::WeakRealmNotifier(WeakRealmNotifier&& rgt) : WeakRealmNotifierBase(std::move(rgt)) +, m_handle(rgt.m_handle) { rgt.m_handle = nullptr; } @@ -53,8 +55,7 @@ WeakRealmNotifier::WeakRealmNotifier(WeakRealmNotifier&& rgt) WeakRealmNotifier& WeakRealmNotifier::operator=(WeakRealmNotifier&& rgt) { WeakRealmNotifierBase::operator=(std::move(rgt)); - m_handle = rgt.m_handle; - rgt.m_handle = nullptr; + std::swap(m_handle, rgt.m_handle); return *this; } diff --git a/src/impl/node/weak_realm_notifier.hpp b/src/impl/node/weak_realm_notifier.hpp index eab6b2a3..4b4f57df 100644 --- a/src/impl/node/weak_realm_notifier.hpp +++ b/src/impl/node/weak_realm_notifier.hpp @@ -16,10 +16,10 @@ // //////////////////////////////////////////////////////////////////////////// -#include - #include "impl/weak_realm_notifier_base.hpp" +typedef struct uv_async_s uv_async_t; + namespace realm { class Realm;