On Wed, Mar 26, 2014 at 1:05 AM, Kevin Ingwersen
<ingwie2...@googlemail.com> wrote:
> Hey.
>
> When I create a custom isolate, and then call V8::Dispose(), I get a big 
> error:
>
> #
> # Fatal error in ../../deps/v8/src/isolate.h, line 456
> # CHECK(isolate != __null) failed
> #
>
> ==== C stack trace ===============================
>
>  1: ??
>  2: ??
>  3: ??
>  4: ??
>  5: ??
>  6: ??
>  7: ??
>  8: ??
> Process 24211 stopped
> * thread #2: tid = 0x3d7156, 0x0000000100836755 
> node`v8::internal::OS::DebugBreak() + 5 at platform-posix.cc:294, stop reason 
> = EXC_BREAKPOINT (code=EXC_I386_BPT, subcode=0x0)
>     frame #0: 0x0000000100836755 node`v8::internal::OS::DebugBreak() + 5 at 
> platform-posix.cc:294
>    291  #else
>    292  #error Unsupported host architecture.
>    293  #endif
> -> 294  }
>    295
>    296
>    297  // 
> ----------------------------------------------------------------------------
>
> I am initializing my isolate with:
>
>         v8::Isolate *isl = v8::Isolate::New();
>         isl->Enter();
>
> Then the code runs, and at the bottom:
>
>   node_isolate->Exit();
>   node_isolate->Dispose();
>
> A while after is the V8::Dispose(). When i comment this call out, the 
> programm exits just as I expected. Otherwise, it crashes with the posted 
> bunch above. What is the reason for this?
>
> Kind regards, Ingwie.

There is still something that uses the isolate.  Make sure you use
proper scoping in your C++ code, i.e.:

  CHECK(V8::Initialize() == true);
  Isolate* isolate = Isolate::New();
  {
    Isolate::Scope isolate_scope(isolate);
    HandleScope handle_scope(isolate);
    Local<Context> = Context::New(...);
    CHECK(context.IsEmpty() == false);
    {
      Context::Scope context_scope(context);
      // etc.
    }
  }
  CHECK(V8::Dispose() == true);

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
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 v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to