Details
-
Bug
-
Resolution: Cannot Reproduce
-
Not Evaluated
-
4.5.2
-
None
Description
We have an embedded application, that redirects it's output to a separated QWS-Server. The ordering of events seems to be different from the usual standalone approach. Find attached a tiny example to open and close a subwindow. The interesting part is the closing of the subwindow, that is done by emitting a signal to the opener, who handles the signal by destroying the subwindow. It is done in a QueueConnection for not destroying the window during it's event handling.
Before the window is closed, we try to press the Close-Button again, which normally does not have an effect. But in the case of our separated QWS-Server, another ButtonPress-Event is issued, before the window is actually closed. The ButtonPress-event "overtakes" the actual closeRequest and event worse: The close request is handled during the handling of the ButtonPress due to an implicit flush for drawing. It destroys the button an thereby leads to a crash at the end of the ButtonPress-Handling.
We attached the tiny example for reproducing the problem.
- First, you have to start an QWSServer instance with ./closeRequest -qws. The resulting window can just be moved away and ignored.
- Second, the application without QWSServer has to be started with ./closeRequest. Some tracing is done on the application events. The interesting part will be the nesting-level of event-dispatching that is done by intercepting the notify from QApplication.
- We can now open the subwidget by pressing the "open"-button. Afterwards we try to close the subwidget by pressing it's "close"-button. While the application "sleeps" for 5 seconds, we click the "close"-button again.
The application now crashes. Depending on the operating system, the application might continue without a segmentation fault. But in the traces it can be seen, that the destroy of the subwidget is done, while the button is repainted in the ButtonPress-event. Actually it seems to be a bug, that a flush of drawing events can lead to event executions, that might delete the button itself.