Fix wx assertion error - #12363
Merged
Merged
Conversation
Calling destroy inside an event handler seems to cause an error with wx Accessibility GetDescription failing an assertion. Destroying children explicitly is not required. - Tidy onSave / onApply - Add type info for 'catIdToInstanceMap' and 'categoryClasses'
This comment has been minimized.
This comment has been minimized.
seanbudd
approved these changes
May 5, 2021
seanbudd
left a comment
Member
There was a problem hiding this comment.
Looks good to me. I had a search for the origin of those destroy() calls on children and panels and didn't find any specific justification.
LeonarddeR
approved these changes
May 6, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to issue number:
Fixes: #12336
Fixes: #12220
Summary of the issue:
#12220 Causes a wx assertion message when either the Braille or Speech settings panels are open.
This seems to be related to the expando text control used on both panels.
The assertion is in wx's accessibility code, which has been introduced in our latest upgrade of wxPython.
The PR #12292 attempted to fix this by explicitly destroying the expando text control when closing.
In #12292 it was missed that the onSave callback was also called for the apply button.
Description of how this pull request fixes the issue:
While looking at adding an explicit close callback for panels, I noticed that Destroy was being called manually during the event handler.
Scheduling a destroy call after the event handler seems to resolve this issue.
As I understand, destroying children explicitly is not required.
While here also:
Testing strategy:
Manually Testing
Open and exit settigns dialog speech/braille panel open via:
Open braille and speech panels, then open advanced panel, change a setting, apply and save.
Known issues with pull request:
The change that introduced the explicit destroy calls was part of a very large change, I don't know for sure if they were working around some other unwanted behaviour.
Change log entries:
None
Code Review Checklist: