I have a DLL with init, deinit, start, stop, methodcall methods. There is only one isolate scope.In init, I register the platform
platformZ = platform::NewDefaultPlatform(); V8::InitializePlatform(platformZ.get()); V8::Initialize();In start I create the isolate
// Create a new Isolate and make it the current one. isolate = Isolate::New(create_params); Isolate::Scope isolate_scope(isolate); // Create a stack-allocated handle scope. HandleScope handle_scope(isolate); .. Local<Context> context = Context::New(isolate, NULL, global); Context::Scope context_scope(context);In methodCall, I find the instance of MyClass and call myMethod in it. If I don't call isolate_scope, the is a crash after making around 100 calls to myMethod, I get an exception 0xC0000005: Access violation writing location 0x00000000. When I call isolate_scope, the exception does not happen.
Isolate::Scope isolate_scope(isolate); // Go into the existing scope HandleScope handle_scope(isolate);I don't exit the scope by any other instructor. Could someone please tell me why isolate_scope makes it work?. If I call Isolate::Scope isolate_scope(isolate), it does not fail even on making a million calls.