Skip to content

fix: catch runtime error on QModelSubmenu cleanup#151

Merged
tlambert03 merged 1 commit intopyapp-kit:mainfrom
tlambert03:fix-on-reg-change
Nov 5, 2023
Merged

fix: catch runtime error on QModelSubmenu cleanup#151
tlambert03 merged 1 commit intopyapp-kit:mainfrom
tlambert03:fix-on-reg-change

Conversation

@tlambert03
Copy link
Copy Markdown
Member

This fixes #147
There may be other/better ways to fix it. Specifically, we could add a new menus_removed signal to the MenuRegistry, and emit that instead of menu_changed here:

self.menus_changed.emit(changed_ids)

but, until I'm sure that that doesn't have unintended side effects, this should at least catch the case of trying to rebuild a submenu that has just been disposed of.

@codecov
Copy link
Copy Markdown

codecov bot commented Nov 5, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0049cb8) 100.00% compared to head (6851757) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #151   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           31        31           
  Lines         1761      1763    +2     
=========================================
+ Hits          1761      1763    +2     
Files Coverage Δ
src/app_model/backends/qt/_qmenu.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tlambert03 tlambert03 changed the title fix: catch runtime error on submenu cleanup fix: catch runtime error on QModelSubmenu cleanup Nov 5, 2023
@tlambert03 tlambert03 merged commit e88ad44 into pyapp-kit:main Nov 5, 2023
@tlambert03 tlambert03 deleted the fix-on-reg-change branch November 5, 2023 23:11
@tlambert03 tlambert03 added the bug Something isn't working label Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Development

Successfully merging this pull request may close these issues.

Bug: exception during teardown of QModelMenu with submenus

1 participant