diff --git a/source/scriptinterface/third_party/ObjectToIDMap.h b/source/scriptinterface/third_party/ObjectToIDMap.h index 4a5f9ca2f8..8a5911bb5e 100644 --- a/source/scriptinterface/third_party/ObjectToIDMap.h +++ b/source/scriptinterface/third_party/ObjectToIDMap.h @@ -34,9 +34,10 @@ class ObjectIdCache typedef js::PointerHasher Hasher; typedef js::HashMap ObjectIdTable; - public: + NONCOPYABLE(ObjectIdCache); - ObjectIdCache(shared_ptr rt) +public: + ObjectIdCache(shared_ptr rt) : table_(nullptr), m_rt(rt) { JS_AddExtraGCRootsTracer(m_rt->m_rt, ObjectIdCache::Trace, this); @@ -100,11 +101,7 @@ class ObjectIdCache return table_->has(obj); } - private: - - ObjectIdCache(const ObjectIdCache&) {}; - ObjectIdCache& operator= (const ObjectIdCache& other) {}; - +private: static void keyMarkCallback(JSTracer *trc, JSObject *key, void *data) { ObjectIdTable* table = static_cast(data);