Why i can't create HandleScope?

Hellow! I'm having a little trouble!

I'm using v8lib (v8 JavaScript Engine).

In function that is call from reference i'm creating HandleScope, but on it this line program crashes with this segfault.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff5f66700 (LWP 21828)]
0x00007ffff72bcff7 in v8::HandleScope::HandleScope() () from /usr/lib/libv8.so
(gdb) step
Single stepping until exit from function _ZN2v811HandleScopeC2Ev,
which has no line number information.
[Thread 0x7ffff5f66700 (LWP 21828) exited]
[Thread 0x7fffe77fe700 (LWP 21832) exited]
[Thread 0x7fffe7fff700 (LWP 21831) exited]
[Thread 0x7ffff4f64700 (LWP 21830) exited]
[Thread 0x7ffff5765700 (LWP 21829) exited]
[Thread 0x7ffff6767700 (LWP 21827) exited]
[Thread 0x7ffff7ff7700 (LWP 21826) exited]

Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.


And the function:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
void *event_handler(enum mg_event event, struct mg_connection *conn, const struct mg_request_info *request_info, 
  Persistent<Context> *context) {

  void *processed = (void *)"yes";
  
  if (event == MG_NEW_REQUEST) {
    if (strcmp(request_info->uri, "/test.jsx") == 0) {

      HandleScope handle_scope;

      Persistent<Context> x = *context;

      Context::Scope context_scope(x);

    } else {
      processed = NULL;
    }
  } else {
    processed = NULL;
  }
  return processed;
}


Thank you!
Topic archived. No new replies allowed.