Crash upon quit when a movable modal is displayed

If I have a specific movable modal window displayed when the app quits, it crashes. I could not find a way to work around.

I am posting the crash report here.

Any hint will be appreciated.

To understand this correctly: you open this window upon the user quitting the application (for example to ask him if he really wants to quit)? Or is this window already on the screen when the user quits?

Where do you show the dialog?
In App.Close or App.CancelClose?

These are the last two steps in your code:

MovableLabel.Event_ContextualMenuAction%b%o<MovableLabel>o<MenuItem> Window.ShowModal%%o<Window>
The user executes a menu item in a contextual menu, then a window is open and showed modally.

– Call App.Quit in MovableLabel.Event_ContextualMenuAction (do not open the “Quit? Yes or No” window in there).
– And the “Quit? Yes or No” window should be showed modally in the App.CancelClose event.

I display a modal window so the user can pick font and font size. If the app quits while the window is open, the crash occurs. It is not a common occurrence, but it looks bad.

OK. I found the workaround.

I added a menu handler for FileQuit, and in there, I check if the model is not nil, so I can close it before actually quitting.

Could this be a workaround (not tested)?
In App.CancelClose check to see if the dialog is open and abort quit if it is? (and the other way around…)

You beat me to it :stuck_out_tongue:

This is atypical case of when the question has been asked, the answer comes by itself :slight_smile:

Thank you Albin.