Skip to content

Commit

Permalink
Fixes missing native_activity::finish
Browse files Browse the repository at this point in the history
Fixes an issue with current version of the ndk-glue library not automatically calling finish at the of an android main tagged function (more details here: rust-mobile/ndk#154)
  • Loading branch information
korejan committed Mar 17, 2022
1 parent ab408dc commit 97c7669
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions alvr/openxr-client/oxr-android-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ pub fn main() {
resumed: false,
};
test(&mut app).unwrap();
// the ndk_glue api does not automatically call this and without
// it main will hang on exit, currently there seems to be no plans to
// make it automatic, refer to:
// https://github.com/rust-windowing/android-ndk-rs/issues/154
ndk_glue::native_activity().finish();
}

pub const LOOPER_ID_MAIN: u32 = 0;
Expand Down

0 comments on commit 97c7669

Please sign in to comment.