[PyQt] APPCrash on exit, Qt4 MainWindow

Phil Thompson phil at riverbankcomputing.com
Wed Jul 3 15:07:02 BST 2013


On Wed, 3 Jul 2013 06:58:56 -0700 (PDT), egus <egusis at gmail.com> wrote:
> Thanks for the direction Phil.
> 
> I added sip.setdestroyonexit(False) to__init__ in my MainWindow class
and
> that appears to have negated the crashing on the two apps I tried it on.
> Simply commenting that command out again caused the same apps to crash
> after
> adding it.  So it's definitely the right direction.
> 
> My limited knowledge of sip, do I risk any memory leaks or other
unexpected
> behavior by bypassing the c++ destructor call this way? Are there any
> cleanup methods/calls I should add when setting setdestroyonexit to
False?

It depends on what your application does after the interpreter exits. If
it's just a Python script (ie. not embedded in a larger application) then
the process is about to terminate anyway. This is the default behaviour of
PyQt5.

Phil


More information about the PyQt mailing list