Skip to content

Commit

Permalink
Merge pull request #5532 from fyne-io/dweymouth-patch-1
Browse files Browse the repository at this point in the history
Fix quitting on wrong goroutine in response to Ctrl+C
  • Loading branch information
dweymouth authored Feb 13, 2025
2 parents 2ba3641 + 24e9a0c commit f642bd5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/driver/glfw/driver_desktop.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,13 @@ func (d *gLDriver) CurrentKeyModifiers() fyne.KeyModifier {
return d.currentKeyModifiers
}

// this function should be invoked from a goroutine
func (d *gLDriver) catchTerm() {
terminateSignal := make(chan os.Signal, 1)
signal.Notify(terminateSignal, syscall.SIGINT, syscall.SIGTERM)

<-terminateSignal
d.Quit()
fyne.Do(d.Quit)
}

func addMissingQuitForMenu(menu *fyne.Menu, d *gLDriver) {
Expand Down

0 comments on commit f642bd5

Please sign in to comment.