mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 03:01:45 +08:00
Patch 1 (#2352)
* update function notifyListeners in events.js newEventListenerList will delete wrong listener if it call splice method in for-loop. * Update events.js --------- Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
This commit is contained in:
parent
dcfd525dd1
commit
0212698714
@ -97,7 +97,7 @@ function notifyListeners(eventData) {
|
||||
const newEventListenerList = eventListeners[eventName].slice();
|
||||
|
||||
// Iterate listeners
|
||||
for (let count = 0; count < eventListeners[eventName].length; count += 1) {
|
||||
for (let count = eventListeners[eventName].length - 1; count >= 0; count -= 1) {
|
||||
|
||||
// Get next listener
|
||||
const listener = eventListeners[eventName][count];
|
||||
|
Loading…
Reference in New Issue
Block a user