Commit 797a23c
fix: Prevent list modification during iteration in BrowserPool
Both `_identify_inactive_browsers` and `_close_inactive_browsers` methods
were modifying their respective lists (`_active_browsers` and
`_inactive_browsers`) while iterating over them. This is a classic bug
that can cause items to be skipped or raise RuntimeError.
The fix iterates over a copy of the list (`list(...)`) while modifying
the original, ensuring all items are properly processed.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent fb1e7ee commit 797a23c
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
349 | | - | |
| 349 | + | |
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
356 | | - | |
| 356 | + | |
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
0 commit comments