Hey Guys,
Running into a runtime issue with GtkMozEmbed. When I call
gtk_moz_embed_get_nsIWebBrowser, I'm getting a segfault with a stack
trace that's pointing to NULL.
(gdb) bt
#0 0x00000000 in ?? ()
#1 0x0807b91f in mozilla_purge_history (embed=0x80d5810 [GtkMozEmbed],
full_purge=1) at mozilla.c:292
#2 0x08066e9d in moz_embed_uri_open (moz_embed=0x80d5810 [GtkMozEmbed],
uri=
0x87522d0 "http://localhost/main_menu.php") at moz_embed.c:336
290 if (embed != NULL && GTK_IS_MOZ_EMBED (embed)) {
291 gtk_moz_embed_get_nsIWebBrowser (GTK_MOZ_EMBED(embed),
292 &browser);
293 //getter_AddRefs(browser));
294 }
I've tried with getter_AddRefs based on browser being declared as
nsCOMPtr<nsIWebBrowser> browser;
And above with browser declared as
nsIWebBrowser *browser;
Behaves the same way in both instances. This would seem to be a runtime
issue. I'm using XPCOM_GLUE and attempted to follow the standalone glue
model.
Does anyone have any tips. I can't see what could be wrong. I've
verified that the 'embed' parameter is valid and is a GtkMozEmbed
object. I can follow the stack through some of the marshalling code with
GDB.
If I step into the call to gtk_moz_emed_get_nsIWebBrowser, I can see it
going into
GType gtk_moz_embed_get_type(void). The static GType varaible in there
is not 0, so it steps down to the return part of the function. Stepping
on the return call takes me to
GTypeInstance* g_type_check_instance_cast (GTypeInstance *type_instance,
GType iface_type).
In there I can see that type_instance is GtkMozEmbed
(gdb) print type_instance
$1 = 0x80d5810 [GtkMozEmbed]
In the gtype.c code it performs a few checks and then if check variable
is TRUE, it returns type_instance. This the point where it fails and I
get a segfault in 0x0000000
This to me points to some sort of runtime late binding issue.
--
Glen Gray<sla...@slaine.org>
http://slaine.org
_______________________________________________
dev-embedding mailing list
dev-embedding@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-embedding