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

Fix Sudden Crash from Exitting Main Loop #814

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
last_frame_time: f64,
frame_time: f64,

#[cfg(one_screenshot)]

Check warning on line 217 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Cross-compile (macos-latest, x86_64-apple-darwin)

unexpected `cfg` condition name: `one_screenshot`

Check warning on line 217 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Cross-compile (ubuntu-latest, wasm32-unknown-unknown)

unexpected `cfg` condition name: `one_screenshot`

Check warning on line 217 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Cross-compile (ubuntu-latest, x86_64-unknown-linux-gnu)

unexpected `cfg` condition name: `one_screenshot`

Check warning on line 217 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Cross-compile (ubuntu-latest, x86_64-pc-windows-gnu)

unexpected `cfg` condition name: `one_screenshot`

Check warning on line 217 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Cross-compile (windows-latest, x86_64-pc-windows-msvc)

unexpected `cfg` condition name: `one_screenshot`
counter: usize,

camera_stack: Vec<camera::CameraState>,
Expand Down Expand Up @@ -347,7 +347,7 @@
last_frame_time: miniquad::date::now(),
frame_time: 1. / 60.,

#[cfg(one_screenshot)]

Check warning on line 350 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Cross-compile (macos-latest, x86_64-apple-darwin)

unexpected `cfg` condition name: `one_screenshot`

Check warning on line 350 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Cross-compile (ubuntu-latest, wasm32-unknown-unknown)

unexpected `cfg` condition name: `one_screenshot`

Check warning on line 350 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Cross-compile (ubuntu-latest, x86_64-unknown-linux-gnu)

unexpected `cfg` condition name: `one_screenshot`

Check warning on line 350 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Cross-compile (ubuntu-latest, x86_64-pc-windows-gnu)

unexpected `cfg` condition name: `one_screenshot`

Check warning on line 350 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Cross-compile (windows-latest, x86_64-pc-windows-msvc)

unexpected `cfg` condition name: `one_screenshot`
counter: 0,
unwind: false,
recovery_future: None,
Expand Down Expand Up @@ -397,7 +397,7 @@

get_quad_context().commit_frame();

#[cfg(one_screenshot)]

Check warning on line 400 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Cross-compile (macos-latest, x86_64-apple-darwin)

unexpected `cfg` condition name: `one_screenshot`

Check warning on line 400 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Cross-compile (ubuntu-latest, wasm32-unknown-unknown)

unexpected `cfg` condition name: `one_screenshot`

Check warning on line 400 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Cross-compile (ubuntu-latest, x86_64-unknown-linux-gnu)

unexpected `cfg` condition name: `one_screenshot`

Check warning on line 400 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Cross-compile (ubuntu-latest, x86_64-pc-windows-gnu)

unexpected `cfg` condition name: `one_screenshot`

Check warning on line 400 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Cross-compile (windows-latest, x86_64-pc-windows-msvc)

unexpected `cfg` condition name: `one_screenshot`
{
get_context().counter += 1;
if get_context().counter == 3 {
Expand Down Expand Up @@ -856,7 +856,12 @@
miniquad::start(miniquad_conf, move || {
thread_assert::set_thread_id();
unsafe {
MAIN_FUTURE = Some(Box::pin(future));
MAIN_FUTURE = Some(Box::pin(async {
future.await;
if let Some(ctx) = CONTEXT.as_mut() {
ctx.gl.reset();
}
}));
}
let mut context = Context::new();
context.update_on = update_on.unwrap_or_default();
Expand Down
Loading