[Webkit-unassigned] [Bug 16401] [GTK] GObject/C DOM binding

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 17 17:25:10 PDT 2008


https://bugs.webkit.org/show_bug.cgi?id=16401





------- Comment #94 from mrowe at apple.com  2008-10-17 17:25 PDT -------
(In reply to comment #92)
> > I don't think the generated bindings code should be calling ref() or deref()
> > explicitly at all.  Managing the lifetimes of the wrapped objects via a RefPtr
> > is almost certainly sufficient.
> 
>  then why did the code crash, without them (without the ref and deref), and why
> are the ObjC bindings using the ref and deref technique, which i am copying,
> verbatim?

The Objective-C bindings do not use RefPtr's as until relatively recently it
was not valid for an Objective-C object to directly contain a non-POD C++ type.

>  btw i've taken a quick look at the GDOMBindings.cpp, i believe i may have
> spotted an error, in the toGDOM(Element*) implementation.  comparing each call
> of ref(), there are a couple that are inconsistent: one calls doc->ref() which
> i don't think it should.
> 
>  ... but... i copied this technique from JSBindings and ObjC bindings - why
> should these bindings be different?

It would seem that you have copied from both the JS bindings and the
Objective-C bindings, and ended up using a mismatch of manual reference
counting and automated reference counting.  You should do one or the other, not
both.  In this case the automated approach is the best approach.  Understanding
how reference counting works, and how our types that automate reference
counting behave, will help prevent these sorts of issues in the future.


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list