Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ApplicationWindow isn't cleaning up StatusBarManager #539

Open
ievacerny opened this issue Jun 11, 2020 · 1 comment
Open

ApplicationWindow isn't cleaning up StatusBarManager #539

ievacerny opened this issue Jun 11, 2020 · 1 comment

Comments

@ievacerny
Copy link
Contributor

Qt ApplicationWindow tests are leaking QStatusBar:

ApplicationWindow tests output
QObjects at start of test run: {'QApplication': 2}.
[Wed Jun 10 22:41:07 2020] ( 1/16) test_activate (pyface.tests.test_application_window.TestApplicationWindow) ... ok
[Wed Jun 10 22:41:07 2020] ( 2/16) test_close (pyface.tests.test_application_window.TestApplicationWindow) ... ok
[Wed Jun 10 22:41:08 2020] ( 3/16) test_icon (pyface.tests.test_application_window.TestApplicationWindow) ... ok
[Wed Jun 10 22:41:08 2020] ( 4/16) test_menubar (pyface.tests.test_application_window.TestApplicationWindow) ... ok
test_menubar (pyface.tests.test_application_window.TestApplicationWindow) changed QObject counts. added: {'QAction': 5}.
[Wed Jun 10 22:41:08 2020] ( 5/16) test_open_close (pyface.tests.test_application_window.TestApplicationWindow) ... ok
[Wed Jun 10 22:41:08 2020] ( 6/16) test_position (pyface.tests.test_application_window.TestApplicationWindow) ... ok
[Wed Jun 10 22:41:09 2020] ( 7/16) test_reposition (pyface.tests.test_application_window.TestApplicationWindow) ... ok
[Wed Jun 10 22:41:09 2020] ( 8/16) test_resize (pyface.tests.test_application_window.TestApplicationWindow) ... ok
[Wed Jun 10 22:41:09 2020] ( 9/16) test_retitle (pyface.tests.test_application_window.TestApplicationWindow) ... ok
[Wed Jun 10 22:41:09 2020] (10/16) test_show (pyface.tests.test_application_window.TestApplicationWindow) ... ok
[Wed Jun 10 22:41:09 2020] (11/16) test_size (pyface.tests.test_application_window.TestApplicationWindow) ... ok
[Wed Jun 10 22:41:10 2020] (12/16) test_statusbar (pyface.tests.test_application_window.TestApplicationWindow) ... ok
test_statusbar (pyface.tests.test_application_window.TestApplicationWindow) changed QObject counts. added: {'QStatusBar': 1}.
[Wed Jun 10 22:41:10 2020] (13/16) test_statusbar_changed (pyface.tests.test_application_window.TestApplicationWindow) ... ok
test_statusbar_changed (pyface.tests.test_application_window.TestApplicationWindow) changed QObject counts. added: {'QStatusBar': 1}.
[Wed Jun 10 22:41:10 2020] (14/16) test_title (pyface.tests.test_application_window.TestApplicationWindow) ... ok
[Wed Jun 10 22:41:10 2020] (15/16) test_toolbar (pyface.tests.test_application_window.TestApplicationWindow) ... ok
test_toolbar (pyface.tests.test_application_window.TestApplicationWindow) changed QObject counts. added: {'QAction': 5, '_ToolBar': 1}.
[Wed Jun 10 22:41:10 2020] (16/16) test_toolbar_changed (pyface.tests.test_application_window.TestApplicationWindow) ... ok
test_toolbar_changed (pyface.tests.test_application_window.TestApplicationWindow) changed QObject counts. added: {'QAction': 5, '_ToolBar': 1}.
QObjects at end of test run: {'QApplication': 2, 'QAction': 15, 'QStatusBar': 2, '_ToolBar': 2}.

In MApplicationWindow, MenuBarManager and ToolBarManager are destroyed but not StatusBarManager. This can be done via destroy_status_bar (qt) or remove_status_bar (wx).

The first step would probably be bringing qt and wx interfaces together and then simply adding a couple lines of code to MApplicationWindow.

@johannesloibl
Copy link
Contributor

I was debugging an entire day now to find out why my GUI tests in pytest are crashing, until I found out that StatusBarManager is not properly recycled. Then I found this issue :D
I'll fix this and add a PR now

johannesloibl added a commit to johannesloibl/pyface that referenced this issue Jul 1, 2022
- Streamline naming of destroy function of StatusBarManager Qt and wx implementation
- Add destroying of StatusBarManager when application is destroyed
johannesloibl added a commit to johannesloibl/pyface that referenced this issue Jul 1, 2022
corranwebster pushed a commit that referenced this issue Jul 2, 2022
* ApplicationWindow isn't cleaning up StatusBarManager (#539)

- Streamline naming of destroy function of StatusBarManager Qt and wx implementation
- Add destroying of StatusBarManager when application is destroyed

* Rename references (#539 cont.)
corranwebster pushed a commit that referenced this issue Jul 4, 2022
* ApplicationWindow isn't cleaning up StatusBarManager (#539)

- Streamline naming of destroy function of StatusBarManager Qt and wx implementation
- Add destroying of StatusBarManager when application is destroyed

* Rename references (#539 cont.)
corranwebster pushed a commit that referenced this issue Jul 11, 2022
* ApplicationWindow isn't cleaning up StatusBarManager (#539)

- Streamline naming of destroy function of StatusBarManager Qt and wx implementation
- Add destroying of StatusBarManager when application is destroyed

* Rename references (#539 cont.)
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

No branches or pull requests

2 participants