diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2024-05-14 18:15:05 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2024-05-14 18:15:05 +0200 |
| commit | 66c37e51285a61386c2b41dec777be28805b0a74 (patch) | |
| tree | 720b7d647dad9f1b306598008acfbc6ec8ca75fc /test/cube.cxx | |
| parent | 79c3db48cf593ccbe64f6c845af0777caebde2a8 (diff) | |
Fix crash in test/cube under macOS when using Quit menubar item
Diffstat (limited to 'test/cube.cxx')
| -rw-r--r-- | test/cube.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/cube.cxx b/test/cube.cxx index ad668a175..db15d702e 100644 --- a/test/cube.cxx +++ b/test/cube.cxx @@ -3,7 +3,7 @@ // // Modified to have 2 cubes to test multiple OpenGL contexts // -// Copyright 1998-2023 by Bill Spitzak and others. +// Copyright 1998-2024 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -162,7 +162,6 @@ int done = 0; // set to 1 in exit button callback // exit button callback void exit_cb(Fl_Widget *w, void *) { done = 1; - w->window()->hide(); // necessary if built w/o GL } // print screen demo @@ -206,6 +205,7 @@ void makeform(const char *name) { // main window form = new Fl_Window(form_w, form_h, name); + form->callback(exit_cb); // menu bar Fl_Sys_Menu_Bar *menubar = new Fl_Sys_Menu_Bar(0, 0, form_w, MENUBAR_H); menubar->add("File/Print window", FL_COMMAND+'p', print_cb); @@ -300,6 +300,6 @@ int main(int argc, char **argv) { } return 0; #else - return Fl::run(); + while (!done) Fl::wait(); #endif } |
