Thanks Stephan!  I'm surprised and disappointed I can't guarentee my C++
objects will be destroyed.  Can anyone from Google comment on this?  There
must be a way to force everything allocated to be released at shutdown, no?!


On Fri, May 24, 2013 at 8:35 AM, Stephan Beal <[email protected]> wrote:

> On Fri, May 24, 2013 at 1:53 AM, <[email protected]> wrote:
>
>>  virtual ~Point()
>> {
>> assert(false); // Never called!
>>  }
>>
>
> v8 does not guaranty that it will _ever_ call your destructors. It does
> _not_ clean up automatically when it shuts down. This of course makes life
> difficult for types which require proper closing or close ordering (e.g.,
> db statements and their drivers), but v8 is really centered on types which
> can be "thrown away" without running a destructor.
>
>
>
>> v8::V8::Initialize();  // Initialize v8.  (Is this needed??  If so, why
>> isn't it mentioned here -> https://developers.google.com/v8/embed)
>>
>
> i've been using v8 since 2008 and never seen/used it.
>
>
>>  v8::V8::LowMemoryNotification();  // I saw this mentioned as a way to
>> force GC, but it doesn't help.  Even so, I would think v8::V8::Dispose
>> would clear all garbage.
>>  v8::V8::Dispose();   // Initialize v8.  (Is this needed??  If so, why
>> isn't it mentioned here -> https://developers.google.com/v8/embed)
>>
>
> Whether or not it is needed, i don't know (i don't remember consistently
> using it). It won't, however, guaranty to run any cleanup of your bound
> types. In order for you to start seeing your dtor running, you need to
> create many thousands of them before v8 will start cleaning them up. In
> short-lived test apps the dtors are rarely run. In all of my bound native
> types i tend to bind a destroy() method which manually triggers the
> destruction process. Here's an example of how to do that:
>
>
> https://code.google.com/p/v8-juice/source/browse/convert/include/cvv8/ClassCreator.hpp#980
>
> --
> ----- stephan beal
> http://wanderinghorse.net/home/stephan/
> http://gplus.to/sgbeal
>
> --
> --
> v8-users mailing list
> [email protected]
> http://groups.google.com/group/v8-users
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "v8-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/v8-users/ta9wkdEY08o/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
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/groups/opt_out.


Reply via email to