[PyKDE] canvas related segfault
Hans-Peter Jansen
hpj at urpla.net
Thu Feb 10 16:12:16 GMT 2005
[resend to the ML, since it is of public interest]
On Thursday 10 February 2005 11:08, Phil Thompson wrote:
> > Hi Phil,
> >
> > there was a nice little qt tile based imaging example published
> > today in the german linux magazine, and I thought, it would be
> > nice to play with in PyQt, thus I converted it. Now it appears,
> > that after loading an image and quitting, it segfaults
> > reproducible, unless I use the WDestructiveClose flag on the main
> > window. Here's a typical backtrace:
>
> I haven't looked at this in detail, but the comments at the bottom
> of canvas.py in the PyQt examples might be relevant here.
Hmm, none of these lines below app.exec_loop() seems to be needed here
as everthing is destructed just fine without them. So maybe this
comment is misleading or outdated. BTW, doesn't that example miss
some global statements at least?
But you pushed me in the right direction (again): the most interesting
part of this example is the clear() method: it iterates over all
canvas items and calls setCanvas(None) before deletimg them. It would
be nice to make this call transparently in the destructor of canvas
items to get on par with C++, if possible. At least, I can't find
such a notion in the Qt canvas.cpp example. If I'm going to do
something serious with canvases, I would try to fix this myself.
Thanks,
Pete
More information about the PyQt
mailing list