File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -409,9 +409,21 @@ def _cleanup_all_tabs(self):
409409 This helper method is used by on_quit to clean up all tabs when
410410 closing the application. For closing a single tab, use
411411 tab.cleanup_resources() directly.
412+
413+ Each tab's cleanup is wrapped in try/except to ensure all tabs
414+ get cleaned up even if one fails.
412415 """
413- for tab in self .tabs_panels :
414- tab .cleanup_resources ()
416+ for index , tab in enumerate (self .tabs_panels ):
417+ try :
418+ tab .cleanup_resources ()
419+ except Exception as e :
420+ # Log error but continue cleaning up other tabs
421+ log .error (
422+ "Error cleaning up resources for tab at index %d: %s" ,
423+ index ,
424+ e ,
425+ exc_info = True ,
426+ )
415427
416428 def on_close (self , event : wx .Event | None ):
417429 """Handle the close event for the main application frame.
You can’t perform that action at this time.
0 commit comments