Hi, Stephan,
It seems possible that v8::IsDead() returns true before main() exit. Please check the following comments in v8.h /** * Check if V8 is dead and therefore unusable. This is the case after * fatal errors such as out-of-memory situations. */ static bool IsDead(); >From the comments, it looks like IsDead() will return true in situation of fatal exception like OOM(out of memory). I think we can catch OOM exception in main() using C++ SEH. About whether we can re-initialize v8 or not, I now agree with you that we can't do it. Sincerely~ Xiang On Nov 24, 6:27 pm, Stephan Beal <[email protected]> wrote: > On Mon, Nov 23, 2009 at 12:10 PM, Xiang Zhong <[email protected]> wrote: > > Suppose v8 encounter some fatal exception, like out of memory, and > > v8::V8::IsDead() return true. > > > Is there a way to re-initialize v8 to make it work as normal without > > restarting the program? > > As i understand it (perhaps incorrectly - the docs aren't as clear as they > could be!), IsDead() will return true once static destruction of v8 has > started. If that is indeed the case, IsDead() will not return true until > after main() has returned. This can be important for client-side objects > which use v8 but themselves are also subject to destruction post-main(), > since the destruction order of those objects is unpredictable. > > -- > ----- stephan bealhttp://wanderinghorse.net/home/stephan/ --~--~---------~--~----~------------~-------~--~----~ v8-users mailing list [email protected] http://groups.google.com/group/v8-users -~----------~----~----~----~------~----~------~--~---
