edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
* [Edbrowse-dev] AutoCompartment other window
@ 2014-02-11 11:55 Karl Dahlke
  2014-02-11 15:41 ` Adam Thompson
  0 siblings, 1 reply; 2+ messages in thread
From: Karl Dahlke @ 2014-02-11 11:55 UTC (permalink / raw)
  To: Edbrowse-dev

Well, it only took a couple hours after my cleanup push to run into
a reproducible segfault.
I tracked it down to an AutoCompartment call.
Remember I said they were all gone; there is one that we actually need in html.cpp,
just before we destroy the object associated with the tag.
It's part of freeWindow().
Naturally I used the same old line,
but that sets the compartment of the current window;
we are not always freeing the current window.
q5 will quit session 5, for example.
So this is the only AutoCompartment that is not based on cw.
I fixed this and the segfault went away.

A question for you in jsdom.cpp function domLink().
This line

        JS::RootedObject owner_root(cw->jss->jcx, owner);

Then you use owner_root instead of owner thereafter.
Is this necessary?
owner is safely rooted on the heap and isn't going to go anywhere.
We could just use owner throughout and it would be much clearer.

Karl Dahlke

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Edbrowse-dev] AutoCompartment other window
  2014-02-11 11:55 [Edbrowse-dev] AutoCompartment other window Karl Dahlke
@ 2014-02-11 15:41 ` Adam Thompson
  0 siblings, 0 replies; 2+ messages in thread
From: Adam Thompson @ 2014-02-11 15:41 UTC (permalink / raw)
  To: Karl Dahlke; +Cc: Edbrowse-dev

On Tue, Feb 11, 2014 at 06:55:22AM -0500, Karl Dahlke wrote:
> A question for you in jsdom.cpp function domLink().
> This line
> 
>         JS::RootedObject owner_root(cw->jss->jcx, owner);
> 
> Then you use owner_root instead of owner thereafter.
> Is this necessary?
> owner is safely rooted on the heap and isn't going to go anywhere.
> We could just use owner throughout and it would be much clearer.

That's from when the html parser wasn't js-aware,
I've just pushed a change rectifying this (removing owner_root).

Cheers,
Adam.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-02-11 15:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-11 11:55 [Edbrowse-dev] AutoCompartment other window Karl Dahlke
2014-02-11 15:41 ` Adam Thompson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).