MCPcopy Create free account
hub / github.com/nodejs/nan / Unref

Method Unref

nan_object_wrap.h:107–113  ·  view source on GitHub ↗

Unref() marks an object as detached from the event loop. This is its * default state. When an object with a "weak" reference changes from * attached to detached state it will be freed. Be careful not to access * the object after making this call as it might be gone! * (A "weak reference" means an object that only has a * persistent handle.) * * DO NOT CALL THIS FROM DESTRUCT

Source from the content-addressed store, hash-verified

105 * DO NOT CALL THIS FROM DESTRUCTOR
106 */
107 virtual void Unref() {
108 assert(!persistent().IsEmpty());
109 assert(!persistent().IsWeak());
110 assert(refs_ > 0);
111 if (--refs_ == 0)
112 MakeWeak();
113 }
114
115 int refs_; // ro
116

Callers

nothing calls this directly

Calls 2

IsWeakMethod · 0.80
IsEmptyMethod · 0.45

Tested by

no test coverage detected