Document that AppExit can be read by Bevy apps (#4587)
Explain it's safe to subscribe to this event to detect an exit before it happens. For instance, to clean-up and release system resources.
This commit is contained in:
		
							parent
							
								
									4bcb310008
								
							
						
					
					
						commit
						91f2b51083
					
				@ -920,6 +920,11 @@ fn run_once(mut app: App) {
 | 
				
			|||||||
    app.update();
 | 
					    app.update();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/// An event that indicates the [`App`] should exit. This will fully exit the app process.
 | 
					/// An event that indicates the [`App`] should exit. This will fully exit the app process at the
 | 
				
			||||||
 | 
					/// start of the next tick of the schedule.
 | 
				
			||||||
 | 
					///
 | 
				
			||||||
 | 
					/// You can also use this event to detect that an exit was requested. In order to receive it, systems
 | 
				
			||||||
 | 
					/// subscribing to this event should run after it was emitted and before the schedule of the same
 | 
				
			||||||
 | 
					/// frame is over.
 | 
				
			||||||
#[derive(Debug, Clone, Default)]
 | 
					#[derive(Debug, Clone, Default)]
 | 
				
			||||||
pub struct AppExit;
 | 
					pub struct AppExit;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user