<div><div style="">I always wrap the start-up entry  in a separate function, typically called main(), and never see the Crashes On Exit error , <a href="http://pyqt.sourceforge.net/Docs/PyQt5/gotchas.html#crashes-on-exit" _src="http://pyqt.sourceforge.net/Docs/PyQt5/gotchas.html#crashes-on-exit">http://pyqt.sourceforge.net/Docs/PyQt5/gotchas.html#crashes-on-exit</a> </div><div style=""><br></div><div>def main():</div><div>    app = QApplication(sys.argv)</div><div><br></div><div>    w = QWidget()</div><div>    w.show()</div><div><br></div><div>    app.exec()</div><div><br></div><div>if __name__ == '__main__':</div><div>    main()</div><div style="color: rgb(0, 0, 0); font-family: arial; font-size: 14px;"><br></div><div style="color: rgb(0, 0, 0); font-family: arial; font-size: 14px;"><br></div><div style="color: rgb(0, 0, 0); font-family: arial; font-size: 14px;"><br></div></div><!-- jy5ContentSuffix --><div>在2016年08月16 05时35分, "Phil Thompson"<phil@riverbankcomputing.com>写道:</div><blockquote id="isReplyContent" style="padding-left:1ex; margin: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>On 15 Aug 2016, at 9:11 pm, Carl Wolff <<a href="mailto:carl@wolff-online.nl">carl@wolff-online.nl</a>> wrote:<br>> <br>> Hello,<br>> <br>> I succesfully applied sip. setdestroyonexit on a fairly large pyqt4 application suffering from occasional crashes at exit time.<br>> <br>> My question is twofold:<br>> - why is destroyonexit not set to False by default;<br><br>So as not to change the behaviour of existing applications.<br><br>> - Is it (theoretically) possible to live without using this sip call? E.g. by adhering to guidelines regarding pyqt wrapper/qt ownership and qt/python garbage collection? When I read the API documentation of sip.setdestroyonexit carefully, I get the impression that it is impossible to live without this sip call.<br><br>As far as I can remember I've never used it in my own code.<br><br>Phil<br>_______________________________________________<br>PyQt mailing list    <a href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><br></blockquote><br><br><span title="neteasefooter"><p> </p></span>