Skip to content

Work around wxWidgets assertion - #12292

Merged
feerrenrut merged 1 commit into
masterfrom
fixWxAssertion
Apr 16, 2021
Merged

Work around wxWidgets assertion#12292
feerrenrut merged 1 commit into
masterfrom
fixWxAssertion

Conversation

@feerrenrut

Copy link
Copy Markdown
Contributor

Link to issue number:

#12220

Summary of the issue:

There is a wxAssertion error when closing braille or speech settings panels.

ERROR - unhandled exception (09:33:35.263) - MainThread (7112):
wx._core.wxAssertionError: C++ assertion ""GetWindow() != 0"" failed at ..\..\src\common\wincmn.cpp(3919) in wxWindowAccessible::GetDescription(): 

The above exception was the direct cause of the following exception:
SystemError: <class 'wx._core.WindowDestroyEvent'> returned a result with an error set

There is a lot more information about the investigation on the issue.

Description of how this pull request fixes the issue:

This PR provides a workaround, the true cause of this assertion has not yet been determined.
However in the meantime this PR will prevent the log error, and any aditional instability in WX that may occur due to ending up
in this situation.

Testing strategy:

Exited both the speech and the braille settings panels via pressing enter, esc, clicking on ok, and clicking on cancel.

Known issues with pull request:

None

Change log entry:

None, this issue has not been in a release yet.

Code Review Checklist:

This checklist is a reminder of things commonly forgotten in a new PR.
Authors, please do a self-review and confirm you have considered the following items.
Mark items you have considered by checking them.
You can do this when editing the Pull request description with an x: [ ] becomes [x].
You can also check the checkboxes after the PR is created.

  • Pull Request description is up to date.
  • Unit tests.
  • System (end to end) tests.
  • Manual tests.
  • User Documentation.
  • Change log entry.
  • Context sensitive help for GUI changes.

@feerrenrut feerrenrut self-assigned this Apr 14, 2021
@feerrenrut
feerrenrut merged commit 516706d into master Apr 16, 2021
@feerrenrut
feerrenrut deleted the fixWxAssertion branch April 16, 2021 04:51
@nvaccessAuto nvaccessAuto added this to the 2021.1 milestone Apr 16, 2021
@feerrenrut feerrenrut mentioned this pull request May 5, 2021
7 tasks
feerrenrut added a commit that referenced this pull request May 6, 2021
Fixes: #12336
Fixes: #12220

# Summary of the issue:
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:
- Tidy onSave / onApply
- Add type info for 'catIdToInstanceMap' and 'categoryClasses'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants