Re: [Gtkhtml] Loading urls from GtkHTML::url_requested using GnomeVFSAsyncRead



On Tue, 2002-09-03 at 21:31, Archit Baweja wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi
> 
> Context:
> Writing a html editor using GtkHTML for Preview and the GtkHTML widget is
> emitting the url_requested signal for image files in the webpage.
> 
> Problem:
> So I catch the GtkHTML::url_requested signal. Now I try to write the data
> read by the GnomeVFS asynchronous ops, well just see the code snippet...

> Some how in the url_requested_async_read_cb, the GtkHTMLStream * pointer 
> points to NULL.
> 
> Any ideas?

I don't see how the stream could be set to NULL unless it's coming in as
NULL when you assign it in html_view_url_requested_cb().  And if that's
the case, you'll probably want to do gtk_html_begin() on the HTML widget
to create it.

If it is somehow getting set to NULL (memory corruption?), use gdb's
hardware watchpoints to see where exactly it's happening.  They're
tricky to figure out, but once you've got it, they're quite useful. 
Right after you assign udata->stream in html_view_url_requested_cb(), do
a "print udata" and then a "watch ((AsyncReadData *)
0x80000000)->stream" (obviously replace 0x80000000 with the actual
address).  Don't use variables ($1); gdb sucks.  Then continue, and it
should break whenever it changes.

Joe




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]