kactioncollection and associated widget

Thomas Zander zander at kde.org
Sun Nov 25 19:21:50 GMT 2007


On Wednesday 21 November 2007 01:37:58 Hamish Rodda wrote:
> I've attached a proposed patch

I realized a bug introduced with the patch, one I fixed together with 
David some years ago ;)

If a widget that is in the actioncollections list of associated widgets 
gets deleted the collection has a dangling pointer and you get crashes 
later on.
The solution we had in kde3 (aka, known to work) was to listen to the 
QObject::destroyed (QObject *=0) signal and remove the widget from the 
list doing a single d->associatedWidgets.removeAll(obj);

Cheers
-- 
Thomas Zander
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071125/578d4a95/attachment.sig>


More information about the kde-core-devel mailing list