diff --git a/common/event_emitter.go b/common/event_emitter.go index 13726d8ac..46e13c592 100644 --- a/common/event_emitter.go +++ b/common/event_emitter.go @@ -100,9 +100,9 @@ type NavigationEvent struct { type eventHandler struct { ctx context.Context ch chan Event - queueMutex *sync.Mutex + queueMutex sync.Mutex queue []Event - curQueueMutex *sync.Mutex + curQueueMutex sync.Mutex curQueue []Event } @@ -242,14 +242,6 @@ func (e *BaseEventEmitter) on(ctx context.Context, events []string, ch chan Even // OnAll registers a handler for all events. func (e *BaseEventEmitter) onAll(ctx context.Context, ch chan Event) { e.sync(func() { - e.handlersAll = append(e.handlersAll, - &eventHandler{ - ctx, - ch, - &sync.Mutex{}, - make([]Event, 0), - &sync.Mutex{}, - make([]Event, 0), - }) + e.handlersAll = append(e.handlersAll, &eventHandler{ctx: ctx, ch: ch}) }) }