I have a problem with QueryInterface to base interfaces. It seems that
pyxpcom does an unnecessary and maybe wrong re-wrapping of the object.
The situation is that I have an implementation of nsIChannel in python.
In the mozilla code a pointer to nsIChannel is cast to nsIRequest. Which
is legal because nsIChannel derives from nsIRequest. With this new
pointer to nsIRequest the mozilla code does an QueryInterface to
nsIRequest and expects that it gets the same pointer but it gets a new
one. See Assert_NoQueryNeeded in the mozilla code.
In the above case "nsIChannel-> QueryInterface( IID_nsIChannel ) ==
nsIChannel" as expected but "nsIRequest -> QueryInterface( IID_nsIRequest
) != nsIRequest" which seems wrong to me and the check in
Assert_NoQueryNeeded agrees with that.
<http://lxr.mozilla.org/mozilla1.8/source/xpcom/glue/nsCOMPtr.h#589>
Regards,
Sebastian
_______________________________________________
pyxpcom mailing list
pyxpcom@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs