FXMessageBox class methods are not threadsafe
-
lyle (at lylejohnson)
Lyle asked the OP:
Tim, what is it that you're trying to accomplish in this code (or in the actual code, if this is just an example)? Since all of the GUI stuff needs to take place in the main thread, we usually just reserve threads for long-running (or potentially long-running) activities, e.g. processing data in the background.
-
lyle (at lylejohnson)
OP replied:
This is just an example. The actual code has since been rewritten to use app.addTimeout with :repeat = true in place of the thread, and in fact I'm now calling app.disableThreads for faster GUI updates.
Nonetheless, the segfault is real. You say that "all of the GUI stuff needs to take place in the main thread". But in the FXRuby examples folder, groupbox.rb uses a thread to update a clock. And if you remove the sleep call on line 373, then run the program, click "First", and choose an option from the dropdown, it segfaults after a call to FXMessageBox.information, just like this example.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.