Opened 14 years ago
Closed 13 years ago
Last modified 13 years ago
#11383 closed Bug Report - Crash (fixed)
Closing a screen when using the Qt painter can segfault
| Reported by: | Owned by: | paulh | |
|---|---|---|---|
| Priority: | minor | Milestone: | 0.26.1 |
| Component: | MythTV - User Interface Library | Version: | Master Head |
| Severity: | medium | Keywords: | |
| Cc: | Ticket locked: | no |
Description
This has been observed when closing the volume popup in MythMusic but could affect any screen. To reproduce change to the Qt painter then:-
- Change the volume in MythMusic which shows the volume popup dialog.
- Immediately press ESCAPE to close the dialog.
What's happening is
- The keypressEvent gets passed to MythMusicVolumeDialog::keyPressEvent() which in turn passes it to MythScreenType::keyPressEvent()
- MythScreenType::keyPressEvent() then calls MythScreenType::Close() which then calls MythScreenStack::PopScreen()
- Because we are using the Qt painter there is no fade effect or animation to do so the screen gets deleted right away in PopScreen().
- At this point we return to MythMusicVolumeDialog::keyPressEvent() of the now deleted screen where any access to any members is going to segfault which is what happens in this case.
A simple generic fix would be to change in MythScreenStack::PopScreen()
delete screen;
to
screen->deleteLater();
so the keypressEvent handlers could complete safely before the screen is eventually deleted when control returns to the event loop.
Change History (5)
Note:
See TracTickets
for help on using tickets.

This has been confirmed to fix the segfault https://github.com/paul-h/mythtv/commit/1b92f4c277