[PyQt] kapplication not quiting
Andres Riancho
andres.riancho at gmail.com
Mon Oct 29 17:26:14 GMT 2007
Jim,
On 10/29/07, Jim Bublitz <jbublitz at nwinternet.com> wrote:
> On Monday 29 October 2007 08:04, Andres Riancho wrote:
> > Marcos,
> >
> > On 10/29/07, Marcos Dione <mdione at grulic.org.ar> wrote:
> > > On Mon, Oct 29, 2007 at 09:36:14AM -0300, Andres Riancho wrote:
> > > > And then, I try to kill the object like this:
> > > >
> > > > application.processEvents()
> > > > application.exit(0)
> > > > application.quit()
> > > > del application
> > > >
> > > > But when I try to create a new kapplication using the same lines I
> > > > specified above, I get this error message:
> > > >
> > > > Qt debug: QApplication: There should be max one application
> > > > object
> > >
> > > can you tell us where this code is run? can you post some more code,
> > > or even build a smaller example?
> >
> > While I was trying to create a smaller example, I found another
> > way of creating a crash. Please see the attached example. I will try
> > to create an example that returns "QApplication: There should be max
> > one application object" and i'll get back to you.
>
> I don't have any supporting documentation on this (there may be something on
> the list two or three years ago or maybe even farther back), but I ran into a
> similar problem developing unit tests for PyKDE, where I wanted to construct
> and then tear down KApplication instances.
yes, I saw your post!
> The end result was that it isn't something you can do reliably within a single
> program. You either need to construct a single instance and reuse it, or fork
> a new process for each KApplication instance and then destroy the process
> when done with it..
hmmm...Interesting solution, i'll try to create some code with that.
> I believe this is a KDE or Qt feature and not specific to PyKDE (and the error
> msg above is from Qt). I'm not really sure why it should be the case, but
> can think of a number of possible reasons. I'm fairly sure though that I did
> trace it back to some documentation that indicated it wasn't possible.
Ok, then I won't try to fix the code I have, I will have to rewrite it.
> Someone else can let me know if my memory is faulty.
If someone can add something else to this issue, please do.
--
Andres Riancho
http://w3af.sourceforge.net/
Web Application Attack and Audit Framework
More information about the PyQt
mailing list