File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -295,6 +295,11 @@ impl AndroidAppInner {
295295
296296 unsafe {
297297 let native_app = & self . native_app ;
298+ assert_eq ! (
299+ ndk_sys:: ALooper_forThread ( ) ,
300+ ( * native_app. as_ptr( ) ) . looper,
301+ "Application tried to poll events from non-main thread"
302+ ) ;
298303
299304 let mut fd: i32 = 0 ;
300305 let mut events: i32 = 0 ;
@@ -590,7 +595,7 @@ impl AndroidAppInner {
590595 let mut guard = self . input_receiver . lock ( ) . unwrap ( ) ;
591596
592597 // Make sure we don't hand out more than one receiver at a time because
593- // turning the reciever into an interator will perform a swap_buffers
598+ // turning the receiver into an iterator will perform a swap_buffers
594599 // for the buffered input events which shouldn't happen while we're in
595600 // the middle of iterating events
596601 if let Some ( receiver) = & * guard {
Original file line number Diff line number Diff line change @@ -201,8 +201,9 @@ impl AndroidAppInner {
201201 } ;
202202
203203 trace ! ( "Calling ALooper_pollAll, timeout = {timeout_milliseconds}" ) ;
204- assert ! (
205- !ndk_sys:: ALooper_forThread ( ) . is_null( ) ,
204+ assert_eq ! (
205+ ndk_sys:: ALooper_forThread ( ) ,
206+ self . looper. ptr,
206207 "Application tried to poll events from non-main thread"
207208 ) ;
208209 let id = ndk_sys:: ALooper_pollAll (
You can’t perform that action at this time.
0 commit comments