Skip to content

Commit 3bccd51

Browse files
committed
glib-macros: Make main context the thread-default one in #[async_test]
1 parent e11d097 commit 3bccd51

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

glib-macros/src/async_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub(crate) fn async_test(_args: TokenStream, mut item: TokenStream) -> TokenStre
3434
item_fn.block = syn::parse2(quote::quote! {
3535
{
3636
let main_ctx = glib::MainContext::new();
37-
main_ctx.block_on(async #body)
37+
main_ctx.with_thread_default(move || main_ctx.block_on(async #body))
3838
}
3939
})
4040
.expect("Body parsing failure");

0 commit comments

Comments
 (0)