On Thu, Apr 21, 2011 at 10:57 PM, Dave <[email protected]> wrote:

>    if (obj->GetPointerFromInternalField(1))
>    {
>        return;
>    }
>
>
i had a similar problem when binding ncurses. The curses C++ wrapped i was
using allows parent/child relationships but did not nicely handle the case
where a child is destroyed before a parent (the parent isn't properly
informed), and this was leading to all sorts of unpredictable crashes. The
heuristic i ended up using was: upon destruction, if the to-be-destroyed
object has a parent object then _do not_ delete it, under the assumption
that the parent will eventually free it. If it does not have a parent,
destroy it (which will destroy its children, too). A similar approach might
work in your case, but would require the overhead of adding proper
parent/child mappings to your class.

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to