Skip to content

Conversation

@ruck94301
Copy link
Contributor

As I was developing another gui dialog for a different feature,
I learned that calling wx.App() multiple times can be problematic and is strongly advised against.
Presently it's called once with creation of a registration dialog,
and once in gui_main.main_window.

Although the developers haven't seen problems with the existing implementation --
maybe because the wx.App obj used by the registration dialog is garbage collected before gui_main.main_window is run? --
it makes sense to follow wx convention, and avoid calling wx.App() twice.

This PR removes the calls in gui_main.main_window and registration.registration,
and replaces them with a single call in main.py to mywx.App(). In addition, the mywx.App function adds protection so that if it is inadvertently called multiple times, it avoids instantiating another wx.App object.

@yujiahu415 yujiahu415 merged commit 5d58231 into umyelab:master Oct 28, 2025
4 checks passed
@btmlnsn
Copy link
Contributor

btmlnsn commented Oct 29, 2025

Nice catch @ruck94301

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