On Tue, May 10, 2016 at 4:37 PM, Joris Wijnant <[email protected]> wrote: > Hi, > > Do you know it which cases Isolate::GetCurrent() will return NULL? > because i'm trying to execute the following code > > v8::Locker lock(m_pIsolate); > v8::HandleScope scope(m_pIsolate); > > v8::Local<v8::Object> v8Global = m_pContext->Get(m_pIsolate)->Global(); > v8::Local<v8::Value> v8Value = > v8Global->GetRealNamedProperty(v8::String::NewFromUtf8(m_pIsolate, > strName.c_str())); > > which will break, because GetCurrent does not find the isolate ( call stack > at the moment of crash, see below) > simple calling Isolate::GetCurrent() will give the same result. > Jochen mentioned that GetCurrent() will be phased out, to i'm limiting the > usage of it, but this case is inside the V8 api, so outside of my control. > > I assume that something, somewhere is corrupted. but i have no idea where, > can you help me? > > > 00000000() Unknown > [Frames below may be incorrect and/or missing] >> VoxJavascriptTest.exe!v8::base::OS::Abort() Line 836 C++ > VoxJavascriptTest.exe!V8_Fatal(const char * file, int line, const char * > format, ...) Line 117 C++ > VoxJavascriptTest.exe!v8::internal::Isolate::Current() Line 494 C++ > > VoxJavascriptTest.exe!v8::Object::GetRealNamedProperty(v8::Local<v8::Context> > context, v8::Local<v8::Name> key) Line 4288 C++ > > VoxJavascriptTest.exe!v8::Object::GetRealNamedProperty(v8::Local<v8::String> > key) Line 4304 C++ > VoxJavascriptTest.exe!CScriptContext::GetVariable(const ustring & strName, > std::shared_ptr<CJSValue> spVariable) Line 470 C++ > VoxJavascriptTest.exe!main(int argc, char * * argv) Line 208 C++ > [External Code]
Hoi Joris, does it work when you stick in an v8::Isolate::Scope after the v8::Locker? You may want to consider adding a v8::Context::Scope as well. -- -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
