mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-30 05:10:03 -04:00
Change run_app(app: &mut A) to run_app(app: A) (#3721)
This allows the user more control over how they pass their application state to Winit, and will hopefully allow `Drop` implementations on the application handler to work in the future on all platforms.
This commit is contained in:
@@ -500,7 +500,7 @@ impl EventLoop {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn run_app<A: ApplicationHandler>(mut self, app: &mut A) -> Result<(), EventLoopError> {
|
||||
pub fn run_app<A: ApplicationHandler>(mut self, mut app: A) -> Result<(), EventLoopError> {
|
||||
let mut start_cause = StartCause::Init;
|
||||
loop {
|
||||
app.new_events(&self.window_target, start_cause);
|
||||
@@ -567,7 +567,7 @@ impl EventLoop {
|
||||
orbital_event.to_option(),
|
||||
event_state,
|
||||
&self.window_target,
|
||||
app,
|
||||
&mut app,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user