Mailing List Archive

[MythTV/mythtv] 18922a: MythFrontend: Fix valgrind error in ExitPrompter
Branch: refs/heads/master
Home: https://github.com/MythTV/mythtv
Commit: 18922a7a1dc45e3621672b9cfcee54d54aabb9aa
https://github.com/MythTV/mythtv/commit/18922a7a1dc45e3621672b9cfcee54d54aabb9aa
Author: Klaas de Waal <klaas@kldo.nl>
Date: 2021-07-30 (Fri, 30 Jul 2021)

Changed paths:
M mythtv/programs/mythfrontend/exitprompt.cpp

Log Message:
-----------
MythFrontend: Fix valgrind error in ExitPrompter

In the destructor of the ExitPrompter of mythfrontend the MythDialogBox is
reconfigured with a SetReturnEvent call so that it does not respond to
keypresses anymore after the ExitPrompter is deleted.
According to the description in commit 9f1005638a34e2a2b20632e09fe093adfddbe1b,
where this functionality was introduced, this is a fix for a crash which can
happen if the ExitPrompter is deleted before the MythDialogBox.
The problem with this fix is that it, as reported by valgrind, accesses the
MythDialogBox via m_dialog after the MythDialogBox is deleted.
The delete of MythDialogBox does not clear m_dialog.
The delete of MythDialogBox is triggered by qApp->exit() in ExitPrompter::DoQuit.
Fixed by moving the SetReturnEvent call to DoQuit, before qApp->exit() is called.


_______________________________________________
mythtv-commits mailing list
mythtv-commits@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-commits