Skip to content

Commit 972181b

Browse files
authored
fix: eliminate duplicate configSnapshot() in app activation path (#494)
Pass the already-captured config to handleAdditionalAccessibility instead of taking a second snapshot. This ensures the Enable check and bundle ID lists come from the same config version, avoiding a theoretical race condition during config reload.
1 parent 9d22a6e commit 972181b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

internal/app/lifecycle.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,14 +402,13 @@ func (a *App) handleAppActivation(bundleID string) {
402402

403403
if cfg.Hints.Enabled {
404404
if cfg.Hints.AdditionalAXSupport.Enable {
405-
a.handleAdditionalAccessibility(bundleID)
405+
a.handleAdditionalAccessibility(bundleID, cfg)
406406
}
407407
}
408408
}
409409

410410
// handleAdditionalAccessibility configures accessibility support for Electron/Chromium/Firefox applications.
411-
func (a *App) handleAdditionalAccessibility(bundleID string) {
412-
cfg := a.configSnapshot()
411+
func (a *App) handleAdditionalAccessibility(bundleID string, cfg *config.Config) {
413412
config := cfg.Hints.AdditionalAXSupport
414413

415414
if electron.ShouldEnableElectronSupport(bundleID, config.AdditionalElectronBundles) {

0 commit comments

Comments
 (0)