From 80de5dd824011b0eabf573cf4546c8e59b251bf7 Mon Sep 17 00:00:00 2001 From: Jake Stanger Date: Sun, 24 Dec 2023 13:37:20 +0000 Subject: [PATCH] fix: some modules crashing due to recent gtk refactor 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 --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 0fee3d9..7dcb8b7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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; @@ -370,5 +370,5 @@ where /// /// TODO: remove all instances of this once async trait funcs are stable pub fn await_sync(f: F) -> F::Output { - block_in_place(|| Handle::current().block_on(f)) + block_in_place(|| Ironbar::runtime().block_on(f)) }