Don't drop tokio runtime immediately
This commit is contained in:
1 file changed
+2
-5
@@ -113,11 +113,8 @@ pub fn launch_with_props<P: 'static>(root: Component<P>, props: P, cfg: Config)
|
|||||||
// We start the tokio runtime *on this thread*
|
// We start the tokio runtime *on this thread*
|
||||||
// Any future we poll later will use this runtime to spawn tasks and for IO
|
// Any future we poll later will use this runtime to spawn tasks and for IO
|
||||||
// I would love to just allow dioxus to work with any runtime... but tokio is weird
|
// I would love to just allow dioxus to work with any runtime... but tokio is weird
|
||||||
let _guard = Builder::new_multi_thread()
|
let rt = &Builder::new_multi_thread().enable_all().build().unwrap();
|
||||||
.enable_all()
|
let _guard = rt.enter();
|
||||||
.build()
|
|
||||||
.unwrap()
|
|
||||||
.enter();
|
|
||||||
|
|
||||||
let (event_loop, mut app) = app::App::new(cfg, props, root);
|
let (event_loop, mut app) = app::App::new(cfg, props, root);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user