Wrap application initialization with `Runtime::enter`

This commit is contained in:
Héctor Ramón Jiménez 2020-02-16 11:25:10 +01:00
parent cf53026b51
commit 75d8de93ae
1 changed files with 2 additions and 2 deletions

View File

@ -123,10 +123,10 @@ pub trait Application: Sized {
Runtime::new(executor, Proxy::new(event_loop.create_proxy()))
};
let (mut application, init_command) = Self::new();
let (mut application, init_command) = runtime.enter(|| Self::new());
runtime.spawn(init_command);
let subscription = application.subscription();
let subscription = runtime.enter(|| application.subscription());
runtime.track(subscription);
let mut title = application.title();