node-cpp-modules icon indicating copy to clipboard operation
node-cpp-modules copied to clipboard

scope.Close() in AsyncAfter

Open juliangruber opened this issue 13 years ago • 2 comments

shouldn't we close the scope in AsyncAfter since we also opened one?

juliangruber avatar Nov 08 '12 19:11 juliangruber

scope.Close(Undefined());

juliangruber avatar Nov 08 '12 19:11 juliangruber

I assume you mean return scope.Close(Undefined());

I don't think you need to call scope.Close() unless you want to 'rescue' a handle from destruction from the HandleScope.

In this case, I don't see why you would need to rescue the Undefined handle, it should just be

return Undefined();

// and let scope to clean up whatever handles it likes the undefined handle won't be cleaned up like other handles, as far as I know.... right?

paulharris avatar Dec 07 '12 09:12 paulharris