Skip to content

Commit

Permalink
fixed a memory bug
Browse files Browse the repository at this point in the history
  • Loading branch information
alob-mtc committed Mar 18, 2023
1 parent 993274e commit ae410f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions eventloop.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ func (e *eventLoop) Main(fn func()) {

func (e *eventLoop) awaitAll() {
for {
e.sync.Lock()
n := len(e.promiseQueue)
e.sync.Unlock()
for i := n - 1; i >= 0; i-- {
e.sync.Lock()
p := e.promiseQueue[i]
e.sync.Unlock()
if p.handler {
<-p.done
//TODO clean up memory (promise)
Expand Down

0 comments on commit ae410f8

Please sign in to comment.