[mythtv-commits] mythtv commit: r14858 by danielk

mythtv at cvs.mythtv.org mythtv at cvs.mythtv.org
Tue Nov 13 01:35:24 UTC 2007


      Author: danielk
        Date: 2007-11-13 01:35:23 +0000 (Tue, 13 Nov 2007)
New Revision: 14858
   Changeset: http://cvs.mythtv.org/trac/changeset/14858

Modified:

   trunk/mythtv/libs/libmyth/mythdialogs.cpp

Log:

Refs #4115. Another set of related fixes for segfaults when using network control.

The first fix is for MythPopupBox::defaultButtonPressedHandler(). When the focus is not on the popup box, like when you're testing mythtv dialogs with using network control from another window, then this handler will return a value > than the number of buttons. Many users of the MythPopupBox dialogs unfortunately do no range checking so this causes a segfault. But even if it didn't it returns the wrong value. This adds another loop which checks the button's isDown() return instead. This should always work, even when the dialog loses focus. But I also check if we found any pressed button from either and print an error message and return Reject if we don't.

The first fix get's us past one set of segfaults, but show2ButtonPopup() and showButtonPopup() are also called outside the Qt event thread at times and since they improperly delete a QObject (the MythPopupBox) this causes segfaults when the Qt processes the defaultButtonPressedHandler() after the dialog is deleted. The fix is simply to use the proper QObject call to delete the dialog. This problem exists in the other static functions in MythPopupBox, but I was able to reliable test the segfaults this caused in the two functions I fixed using network control (it causes segfaults, albeit randomly, in the same dialogs that I used to test the defaultButtonPressedHandler().) I'll fix the others after I locate test cases for them.




More information about the mythtv-commits mailing list