set event stream to None in rust side

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2023-02-15 21:27:50 +08:00
parent bfaa463002
commit d8fe758604
3 changed files with 12 additions and 6 deletions

View File

@@ -134,6 +134,14 @@ impl FlutterHandler {
stream.add(EventToUI::Event(out));
}
}
pub fn close_event_stream(&mut self) {
let mut stream_lock = self.event_stream.write().unwrap();
if let Some(stream) = &*stream_lock {
stream.add(EventToUI::Event("close".to_owned()));
}
*stream_lock = None;
}
}
impl InvokeUiSession for FlutterHandler {