-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Panic when using autogenerated quit in menu if some windows have not been shown #3870
Comments
I /think/ I found the source: We may need a nil check here: fyne/internal/driver/glfw/window_desktop.go Line 320 in 6558290
Called from here: fyne/internal/driver/glfw/menu.go Line 35 in 6558290
This is called on
|
That looks like it is the case I made the following change diff --git a/internal/driver/glfw/window_desktop.go b/internal/driver/glfw/window_desktop.go
index 4be8d1ab2..1d21f8be2 100644
--- a/internal/driver/glfw/window_desktop.go
+++ b/internal/driver/glfw/window_desktop.go
@@ -317,7 +317,9 @@ func (w *window) refresh(_ *glfw.Window) {
}
func (w *window) closed(viewport *glfw.Window) {
- viewport.SetShouldClose(false) // reset the closed flag until we check the veto in processClosed
+ if viewport != nil {
+ viewport.SetShouldClose(false) // reset the closed flag until we check the veto in processClosed
+ }
w.processClosed()
} and updated my go.mod file to point to the modified source and the process no longer panics on exit. Let me know if you would like me to open up a pr with the fix, or if there is a better way of doing this (maybe checking in the menu.go file?) |
Thanks for a well-written bug report and some very useful debugging. Feel free to open a PR against the |
Thanks so much for your help, this is now landed on |
Checklist
Describe the bug
Hi 👋 . First off amazing library, I am having a lot of fun building a UI with it.
I am running into a bug regarding the menu (I think). If I run the code provided and quit the app from the main menu without showing the second window at least once. The program will panic/sigsegv on exit with the following:
How ever if I close the app by hitting the X in the corner, no crash happens
How to reproduce
go run .
Screenshots
No response
Example code
Fyne version
2.3.4
Go compiler version
1.19.8
Operating system and version
Debian 12
Additional Information
If I change the code to remove the menu (and just a have a show button for w2) I am unable to recreate the crash
The text was updated successfully, but these errors were encountered: