From 560e7253989fe63cb80709282a38a97b3eda6977 Mon Sep 17 00:00:00 2001 From: Scott Kyle Date: Tue, 31 May 2016 09:42:21 -0700 Subject: [PATCH] Address some issues in WeakRealmNotifier for Node --- src/impl/node/weak_realm_notifier.cpp | 5 +++-- src/impl/node/weak_realm_notifier.hpp | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) 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;