const char * foo = (const char *) embed_private->mInitialURL; gtk_moz_embed_load_url (GTK_MOZ_EMBED(widget), foo); embed_private->mInitialURL = "";
char * initialURI = g_strdup((const char *) embed_private->currentURI); gtk_moz_embed_load_url (GTK_MOZ_EMBED(widget), initialURI); g_free(initialURI);
gtk_moz_embed_realize(GtkWidget *widget){  GtkMozEmbed        *embed;  GtkMozEmbedPrivate *embed_private;  GdkWindowAttr attributes;  gint attributes_mask;  g_return_if_fail (widget != NULL);  g_return_if_fail (GTK_IS_MOZ_EMBED(widget));  embed = GTK_MOZ_EMBED(widget);  GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED);  attributes.window_type = GDK_WINDOW_CHILD;  attributes.x = widget->allocation.x;  attributes.y = widget->allocation.y;  attributes.width = widget->allocation.width;  attributes.height = widget->allocation.height;  attributes.wclass = GDK_INPUT_OUTPUT;  attributes.visual = gtk_widget_get_visual (widget);  attributes.colormap = gtk_widget_get_colormap (widget);  attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK;  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;  widget->window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask);  gdk_window_set_user_data (widget->window, embed);  widget->style = gtk_style_attach (widget->style, widget->window);  gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);  // now that we're realized, set up the nsIWebBrowser and nsIBaseWindow stuff  embed_private = (GtkMozEmbedPrivate *)embed->data;  // init our window  nsCOMPtr<nsIBaseWindow> webBrowserBaseWindow = do_QueryInterface(embed_private->webBrowser);  g_return_if_fail(webBrowserBaseWindow);  webBrowserBaseWindow->InitWindow(widget, NULL, 0, 0,				   widget->allocation.width, widget->allocation.height);  webBrowserBaseWindow->Create();  PRBool visibility;  webBrowserBaseWindow->GetVisibility(&visibility);  // set our webBrowser object as the content listener object  nsCOMPtr<nsIURIContentListener> uriListener;  uriListener = do_QueryInterface(embed_private->embed);  g_return_if_fail(uriListener);  embed_private->webBrowser->SetParentURIContentListener(uriListener);  // If an initial url was stored, load it  if (embed_private->mInitialURL.Length() > 0)  {	  const char * foo = (const char *) embed_private->mInitialURL;	  gtk_moz_embed_load_url (GTK_MOZ_EMBED(widget), foo);	  embed_private->mInitialURL = "";  }}