mirror of
https://github.com/gopher64/gopher64.git
synced 2026-07-11 01:25:20 +02:00
@@ -181,11 +181,16 @@ pub async fn unload_game(
|
||||
discord_watch_tx: Option<tokio::sync::watch::Sender<()>>,
|
||||
discord_handle: Option<tokio::task::JoinHandle<()>>,
|
||||
) {
|
||||
if let Some(discord_handle) = discord_handle
|
||||
if let Some(mut discord_handle) = discord_handle
|
||||
&& let Some(discord_watch_tx) = discord_watch_tx
|
||||
{
|
||||
let _ = discord_watch_tx.send(());
|
||||
discord_handle.await.unwrap();
|
||||
if tokio::time::timeout(std::time::Duration::from_secs(1), &mut discord_handle)
|
||||
.await
|
||||
.is_err()
|
||||
{
|
||||
discord_handle.abort();
|
||||
}
|
||||
}
|
||||
unsafe { ra_unload_game() };
|
||||
}
|
||||
|
||||
+6
-2
@@ -179,8 +179,12 @@ pub async fn close(
|
||||
usb_handle: Option<tokio::task::JoinHandle<()>>,
|
||||
) {
|
||||
let _ = shutdown_tx.send(());
|
||||
if let Some(handle) = usb_handle {
|
||||
handle.await.unwrap();
|
||||
if let Some(mut handle) = usb_handle
|
||||
&& tokio::time::timeout(std::time::Duration::from_secs(1), &mut handle)
|
||||
.await
|
||||
.is_err()
|
||||
{
|
||||
handle.abort();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user