[PyQt] Another wierd bug with QtWebKit
phil at riverbankcomputing.com
Sun Jan 10 11:32:42 GMT 2010
On Sat, 9 Jan 2010 18:34:21 -0800, Karthik Tharavaad
<karthiktharavaad at gmail.com> wrote:
> On Sat, Jan 9, 2010 at 1:29 PM, Phil Thompson
> <phil at riverbankcomputing.com>wrote:
>> On Sat, 9 Jan 2010 12:03:38 -0800, Karthik Tharavaad
>> <karthiktharavaad at gmail.com> wrote:
>> > Thanks for replying Phil, thats a great point which I didn't think
>> > about.
>> > However 2 points
>> > - Even if the QWebPage does not parent the QNetworkAccessManager,
>> > shouldn't
>> > it still hold a reference to it and keep it from getting deleted?
> So I take it that there is a bug with the pyqt or qt framework?
No, the bug is in your code. The issue is whether PyQt can or should work
around your bug. The classic case is setModel() where a lot of people
(understandably) didn't realise that they should keep an explicit reference
to the model because Qt doesn't take ownership of it. PyQt was changed to
work around this (by taking a hidden reference) because it was the
pragmatic (but not "right") thing to do.
This case fails the "pragmatic" case because it isn't a common bug, and
because the workaround wouldn't work - the extra reference would be held by
the page, but you aren't keeping a reference to the page either.
>> > - Even if the behavior is intended, under no circumstances should my
>> > example program1 crash Python.exe the way it does right now. Is there
>> > something wrong with the error handling code?
>> No - what do you expect to happen?
> I would expect some kind of descriptive error rather than just python.exe
> crashing. Thats usually what happens when I try to do something "bad"
It's Qt that is crashing and PyQt has no way of preventing it or detecting
More information about the PyQt