Hello !
I'm developping an XPCOM component for firefox.
In my component, when I try to get the path and the prePath of the url
of the current page, firefox crashs ....
Code:
OnStateChange(nsIWebProgress* aWebProgress, nsIRequest*
aRequest,PRUint32 aStateFlags, nsresult aStatus)
{
[....]
nsCOMPtr<nsIDOMWindow> domWin;
nsresult rv = aWebProgress->GetDOMWindow(getter_AddRefs(domWin));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDOMDocument> domDoc;
domWin->GetDocument(getter_AddRefs(domDoc));
nsCOMPtr<nsIDOMHTMLDocument> htmlDoc = do_QueryInterface(domDoc); //
the htmlDoc is valid
nsCOMPtr<nsIDocument> doc = do_QueryInterface(domDoc);
nsCAutoString prePath, path;
doc->GetDocumentURI()->GetPrePath(prePath); //here firefox crash he
can't get the prePath
doc->GetDocumentURI()->GetPath(path);
[....]
}
It seems firefox can't get the nsIDocument from the nsIDOMDocument and
so when he attempts to get the path on the execution, he crashs..
Code:
/usr/bin/firefox: line 159: Segmentation fault $AOSS $MOZ_PROGRAM $@
I'm on Suse 10.1 installed on a VMware, but this component ( and this
code) works fine on Window .....
Anybody have clues or ideas for solve my problem ... ?
_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom