Fix crash when exiting unfinished written mode practice with style sheet
The bug was as follows. When a WrittenPracticeWidget using a KLineEdit styled with a qStyleSheet that has focus is deleted this triggers a focus changing event, but the QStyleSheet returns a style that has already been deleted and causes a crash when the invalid style is applied. The obvious solution of responding to the destroyed() event doesn't work, because the destroyed() event happens after the crash. In order to fix this bug, I transistion focus away from the KLineEdit before the focus change preceding deletion. The virtual function, WrittenPracticeWidget::objectDestroyed, avoids having a practice mode switch statement as large as this comment at each delete event. BUG: 332596 REVIEW: 119119
parent
36495e1f
Please register or sign in to comment