[PyQt] Segfault in QMenu.addAction when parent widget is deleted.

J Robert Ray jrobertray at gmail.com
Sat Apr 5 20:26:38 BST 2014


Thanks Phil, and Yuya. I suppose the implied solution is to create the
submenu via python and add it to the parent menu. We've restructured our
code to avoid this situation.
On Apr 5, 2014 11:32 AM, "Phil Thompson" <phil at riverbankcomputing.com>
wrote:

> On 02-04-2014 9:11 pm, J Robert Ray wrote:
>
>> Hi all, I wanted to share this small example program that will
>> segfault.
>>
>> The newest PyQt I have been able to test it with PyQt 4.10 / Qt 4.8.4,
>> so I dont know if it has been fixed already.
>>
>> In boils down to trying to add a new action to a submenu of a menu
>> attached to a widget that has been deleted. Were having this problem
>> due to some asynchronous RPC and getting results back after a user has
>> caused the widget to go away.
>>
>> If anyone can try this in a newer PyQt to see if it still crashes, I
>> would appreciate it.
>>
>
> It will always crash. The difference in behaviour is because the 'sub'
> menu is created by C++ and PyQt does not detect when it gets deleted.
>
> Phil
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20140405/00f7a4d0/attachment.html>


More information about the PyQt mailing list