Skip to content

Commit

Permalink
fix: some modules crashing due to recent gtk refactor
Browse files Browse the repository at this point in the history
Fixes a crash introduced by commit bea442e where the `await_sync` function incorrectly tried to use the current tokio runtime, which it is often outside, instead of the singleton.

Fixes #382
  • Loading branch information
JakeStanger committed Dec 24, 2023
1 parent 29eeefb commit 80de5dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use glib::PropertySet;
use gtk::gdk::Display;
use gtk::prelude::*;
use gtk::Application;
use tokio::runtime::{Handle, Runtime};
use tokio::runtime::Runtime;
use tokio::task::{block_in_place, JoinHandle};
use tracing::{debug, error, info, warn};
use universal_config::ConfigLoader;
Expand Down Expand Up @@ -370,5 +370,5 @@ where
///
/// TODO: remove all instances of this once async trait funcs are stable
pub fn await_sync<F: Future>(f: F) -> F::Output {
block_in_place(|| Handle::current().block_on(f))
block_in_place(|| Ironbar::runtime().block_on(f))
}

0 comments on commit 80de5dd

Please sign in to comment.