diff options
Diffstat (limited to 'src/handle_wrap.h')
-rw-r--r-- | src/handle_wrap.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/handle_wrap.h b/src/handle_wrap.h index 40ee75cd811..13457e7cc53 100644 --- a/src/handle_wrap.h +++ b/src/handle_wrap.h @@ -57,7 +57,11 @@ class HandleWrap : public AsyncWrap { static void Ref(const v8::FunctionCallbackInfo<v8::Value>& args); static void Unref(const v8::FunctionCallbackInfo<v8::Value>& args); - inline uv_handle_t* GetHandle() { return handle__; } + static inline bool IsAlive(const HandleWrap* wrap) { + return wrap != nullptr && wrap->GetHandle() != nullptr; + } + + inline uv_handle_t* GetHandle() const { return handle__; } protected: HandleWrap(Environment* env, |