qapplication_x11.cpp: Change in event-loop behaviour causes crashes.

qt-bugs at trolltech.com qt-bugs at trolltech.com
Tue Jul 30 08:27:20 BST 2002


On Thursday, 25 Jul 2002 17:03, Waldo Bastian wrote:
> A recent change (Qt 3.0.5?) in the event loop handling makes that events
> are being processed in the popup-event loop after the popup has been closed.
> This causes numerous crashes.

Actually, this change didn't go into 3.0.5, it was made shortly after 3.0.5
was released.

> Example: if you have a widget which shows a popupmenu on mousepress and the
> popupmenu has an action such as "Delete" attached to one of the menu-items 
> you often have to delay the action a bit to prevent that you delete the 
> widget that was clicked on before it returns from the mouse-press event 
> handler. If you don't your applications will crash in the mouse press event
> handler.
> 
> Two common ways to do this are QObject::deleteLater() and 
> QTimer::singleShot().
> 
> However, with the recent changes to the event loop both these events are
> now handled from the event-loop of the popupmenu instead of returning to the
> main event loop first. This results in the crashes that these methods were 
> supposed to prevent.
> 
> The attached patch fixes the problem.

Do you have a small example of the problem?  I can't reproduce this crash
at all.

> Cheers,
> Waldo
> -- 
> bastian at kde.org  |   SuSE Labs KDE Developer  |  bastian at suse.com

--
Bradley T Hughes
Trolltech AS, Waldemar Thranes gt. 98, N-0175 Oslo, Norway





More information about the kde-core-devel mailing list