Skip to content

Commit

Permalink
Disable with_event_loop for iOS since it's not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmerlin committed Aug 1, 2024
1 parent 7dfb6a2 commit fdc0ab1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/eframe/src/native/run.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{cell::RefCell, time::Instant};
use std::time::Instant;

use winit::{
application::ApplicationHandler,
Expand Down Expand Up @@ -32,11 +32,12 @@ fn create_event_loop(native_options: &mut epi::NativeOptions) -> Result<EventLoo
///
/// We reuse the event-loop so we can support closing and opening an eframe window
/// multiple times. This is just a limitation of winit.
#[cfg(not(target_os = "ios"))]
fn with_event_loop<R>(
mut native_options: epi::NativeOptions,
f: impl FnOnce(&mut EventLoop<UserEvent>, epi::NativeOptions) -> R,
) -> Result<R> {
thread_local!(static EVENT_LOOP: RefCell<Option<EventLoop<UserEvent>>> = RefCell::new(None));
thread_local!(static EVENT_LOOP: std::cell::RefCell<Option<EventLoop<UserEvent>>> = std::cell::RefCell::new(None));

EVENT_LOOP.with(|event_loop| {
// Since we want to reference NativeOptions when creating the EventLoop we can't
Expand Down

0 comments on commit fdc0ab1

Please sign in to comment.