Local handle is referenced by data structure: handle stack
when 'scope' disposed, related local handles in handle stack will be
release.
More details:
HandleScope::~HandleScope() {
if (!is_closed_) {
Leave();
}
}
void HandleScope::Leave() {
// ......
i::HandleScope::DeleteExtensions(isolate_);
// ......
}
}
Method DeleteExtensions() is implemented in Api.h,
named HandleScopeImplementer::DeleteExtensions()
BR
Jason
2012/5/31 Tony Huang <[email protected]>
> Hi all,
>
> I'm writing a C++ extension for node.js, and meet a question which is
> mentioned in the subject.
>
> I have read the document from the v8 project site:
> https://developers.google.com/v8/embed#handles
>
> But I am still confused about what is disposed while HandleScope is
> disposing.
>
> According to the document, Local<> handles will be disposed at that time,
> but let's look at the following code snip:
> void SayHello() {
> HandleScope scope;
>
> Local<Value> someValue = GetValue();
> }
> In this case, at the end of SayHello, the object someValue as well as
> scope object will be disposed. It's C++ scope behavior, so what else will
> be disposed while disposing the scope object? Is the object referenced by
> "someValue"?
>
> Thank you~
> Best regards
>
> --
> ------------------------------------------------------
> Tony Huang [email protected]
> [email protected]
> [email protected]
>