Skip to content

Commit

Permalink
Merge pull request #5399 from andydotxyz/fix/onclosedloop
Browse files Browse the repository at this point in the history
Fixing lockup if quitting from window close
  • Loading branch information
andydotxyz authored Jan 13, 2025
2 parents 4a30df3 + f3f4a7e commit 36de697
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/driver/glfw/window.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,9 @@ func (w *window) Close() {
}

// trigger callbacks - early so window still exists
if w.onClosed != nil {
w.onClosed()
if fn := w.onClosed; fn != nil {
w.onClosed = nil // avoid possibility of calling twice
fn()
}

w.closing = true
Expand Down

0 comments on commit 36de697

Please sign in to comment.