set event stream to None in rust side

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou committed 2023-02-15 21:28:28 +08:00
1 parent bfaa463002
commit d8fe758604
3 files changed
+12 -6

No files matched your search

+8
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 {