Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7437331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:22:58+00:00 2026-05-29T10:22:58+00:00

This question is in regards to the V8 C++ API. I would like to

  • 0

This question is in regards to the V8 C++ API.

I would like to keep a global reference to a javascript function from a context
That is instead of storing the function in a local handle

Local<Function> init = ...

I would like to store it in a persistent handle

Persistent<Function> init = ...

I think the proper way to do so is like so:

Local<Function> l_init = ...
Persistent<Function> init =  currentScope.Close(l_init);

but currentScope.Close() returns a local handle.
Is it possible for me to cache a handle as a class member so i don’t have to do a Get every frame?

Can i just have Local as a class variable, assign it using currentScope.Close and release it when i’m done with the Dispose function?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:22:59+00:00Added an answer on May 29, 2026 at 10:22 am

    If you would like to store it in a Persistent handle you really don’t need to worry about scope. For the purpose of this discussion the major thing the closing of a scope will do is potentially mark your object for garbage collection.

    In your example I think you want to do the following:

    v8::Persistent<v8::Function> init = v8::Persistent<v8::Function>::New(l_init); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had posted a question in regards to this code. I found that JTextArea
I bumped into an additional question that I needed in regards to this: Using
This question is in regards to UIView's -drawRect function. The Set-Up: My app consists
This question is in regards to this blog entry. https://blog.stackoverflow.com/2008/07/easy-background-tasks-in-aspnet/ All the way at
I have just asked this question an hour ago but with regards to IE8
I'm pretty sure this is a simple question in regards to formatting but here's
I realize that this question is slightly server related and could be posted on
In regards to the answer for this question Passing DataContext into Action() , how
This question regards how one can effectively create and persist event domain objects on
I understand this question can be general but, specifically with regards to ASP.NET MVC,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.