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 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