Skip to content
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

eframe::Frame::close affects following eframe::run_native calls #3002

Closed
zshehov opened this issue Aug 4, 2023 · 1 comment
Closed

eframe::Frame::close affects following eframe::run_native calls #3002

zshehov opened this issue Aug 4, 2023 · 1 comment

Comments

@zshehov
Copy link

zshehov commented Aug 4, 2023

Running on Mac, I have something along the lines:

  if env::var("PATH").is_err() {
      eframe::run_native(
          "bootstrap",
          native_options.clone(),
          Box::new(|_| Box::new(BootstrapApp::new())),
      )
      .unwrap();
  }

  let path = PathBuf::from(
      env::var("PATH").expect("bootstrap phase should set the PATH"),
  );

  // the following results in immediate
  // DEBUG eframe::native::run: Entering the winit event loop (run_return)…
  // DEBUG eframe::native::run: Received Event::LoopDestroyed - saving app state…
  // DEBUG eframe::native::run: eframe window closed
  eframe::run_native(
      "Actual app",
      native_options,
      Box::new(|cc| {
          Box::new(ActualApp::new(cc, path))
      }),
  )

It seems that the event loop is polluted by the close event from the previous run but I'm not sure how it is supposed to be cleaned. Any ideas?

@zshehov zshehov changed the title eframe::Frame.close() affects following eframe::run_native calls eframe::Frame::close affects following eframe::run_native calls Aug 4, 2023
@zshehov
Copy link
Author

zshehov commented Aug 4, 2023

Sorry, this issue was actually meant for the egui repo... Anyway, for some traceability - seems like this is actually handled in winit with #2767

@zshehov zshehov closed this as completed Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant