diff --git a/src/main.rs b/src/main.rs index 08d8401c..a82ca5cd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -60,6 +60,10 @@ fn main() -> Result<()> { state.common.spaces.refresh(); })?; + let _log = state.destroy(); + // drop eventloop before logger + std::mem::drop(event_loop); + Ok(()) } diff --git a/src/state.rs b/src/state.rs index de9bacb9..c8cfcfd1 100644 --- a/src/state.rs +++ b/src/state.rs @@ -30,8 +30,8 @@ use std::{ use std::{collections::VecDeque, time::Duration}; pub struct State { - pub common: Common, pub backend: BackendData, + pub common: Common, } pub struct Common { @@ -195,6 +195,10 @@ impl State { backend: BackendData::Unset, } } + + pub fn destroy(self) -> LogState { + self.common.log + } } #[cfg(feature = "debug")]