Address some issues in WeakRealmNotifier for Node

This commit is contained in:
Scott Kyle 2016-05-31 09:42:21 -07:00
parent 7829cb5f33
commit 560e725398
2 changed files with 5 additions and 4 deletions

View File

@ -17,6 +17,7 @@
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
#include <nan.h> #include <nan.h>
#include <uv.h>
#include "impl/weak_realm_notifier.hpp" #include "impl/weak_realm_notifier.hpp"
@ -46,6 +47,7 @@ WeakRealmNotifier::WeakRealmNotifier(const std::shared_ptr<Realm>& realm, bool c
WeakRealmNotifier::WeakRealmNotifier(WeakRealmNotifier&& rgt) WeakRealmNotifier::WeakRealmNotifier(WeakRealmNotifier&& rgt)
: WeakRealmNotifierBase(std::move(rgt)) : WeakRealmNotifierBase(std::move(rgt))
, m_handle(rgt.m_handle)
{ {
rgt.m_handle = nullptr; rgt.m_handle = nullptr;
} }
@ -53,8 +55,7 @@ WeakRealmNotifier::WeakRealmNotifier(WeakRealmNotifier&& rgt)
WeakRealmNotifier& WeakRealmNotifier::operator=(WeakRealmNotifier&& rgt) WeakRealmNotifier& WeakRealmNotifier::operator=(WeakRealmNotifier&& rgt)
{ {
WeakRealmNotifierBase::operator=(std::move(rgt)); WeakRealmNotifierBase::operator=(std::move(rgt));
m_handle = rgt.m_handle; std::swap(m_handle, rgt.m_handle);
rgt.m_handle = nullptr;
return *this; return *this;
} }

View File

@ -16,10 +16,10 @@
// //
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
#include <uv.h>
#include "impl/weak_realm_notifier_base.hpp" #include "impl/weak_realm_notifier_base.hpp"
typedef struct uv_async_s uv_async_t;
namespace realm { namespace realm {
class Realm; class Realm;