Fix quit #99

Merged
MartinFouilleul merged 1 commits from fix_quit into main 2023-09-11 16:44:56 +00:00
Collaborator

Closes #91.

When receiving an OC_EVENT_WINDOW_CLOSE, or when oc_bridge_request_quit() is called from the wasm app, set a flag to exit the event processing loop in orca_runloop(). At the end of orca_runloop(), call oc_request_quit().
oc_request_quit() sets the global shouldQuit flag to true, and send an event to the main thread. This wakes up the event pump in case we were blocked waiting for events.

This way the main thread immediately sees the shouldQuit flag and exits without delay, with the guarantee that the orca_runloop() thread is joinable.

Closes #91. When receiving an `OC_EVENT_WINDOW_CLOSE`, or when `oc_bridge_request_quit()` is called from the wasm app, set a flag to exit the event processing loop in `orca_runloop()`. At the _end_ of `orca_runloop()`, call `oc_request_quit()`. `oc_request_quit()` sets the global shouldQuit flag to true, _and_ send an event to the main thread. This wakes up the event pump in case we were blocked waiting for events. This way the main thread immediately sees the `shouldQuit` flag and exits without delay, with the guarantee that the `orca_runloop()` thread is joinable.
MartinFouilleul added 1 commit 2023-09-11 16:44:46 +00:00
MartinFouilleul merged commit 313f2e0ad4 into main 2023-09-11 16:44:56 +00:00
MartinFouilleul deleted branch fix_quit 2023-09-11 16:44:56 +00:00
Sign in to join this conversation.
No reviewers
No Label
macOS
windows
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: hmn/orca#99
No description provided.