Skip to content

Commit

Permalink
Join the extra thread at the end of the application of example
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Jun 23, 2024
1 parent c59ef4f commit 5af055a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ pub trait ApplicationHandler {
///
/// // Send an event in a loop
/// let proxy = event_loop.create_proxy();
/// thread::spawn(move || {
/// let background_thread = thread::spawn(move || {
/// let mut i = 0;
/// loop {
/// println!("sending: {i}");
Expand All @@ -162,6 +162,9 @@ pub trait ApplicationHandler {
///
/// event_loop.run_app(&mut app)?;
///
/// drop(app);
/// background_thread.join().unwrap();
///
/// Ok(())
/// }
/// ```
Expand Down

0 comments on commit 5af055a

Please sign in to comment.