mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-11-04 16:35:19 +00:00
opt: remove unnecessary rgba events to decrease memory usage
This commit is contained in:
1 parent
491932cda1
commit
f8c78a6bf2
1 file changed
+6
-2
+6
-2
@@ -291,8 +291,12 @@ impl InvokeUiSession for FlutterHandler {
|
||||
|
||||
fn on_rgba(&self, data: &[u8]) {
|
||||
if let Some(stream) = &*self.event_stream.read().unwrap() {
|
||||
drop(self.rgba.write().unwrap().replace(data.to_owned()));
|
||||
stream.add(EventToUI::Rgba);
|
||||
let former_rgba = self.rgba.write().unwrap().replace(data.to_owned());
|
||||
if former_rgba.is_none() {
|
||||
// The [former_rgba] is none, which means the latest rgba had taken from flutter.
|
||||
// We need to send a signal to flutter for notifying there's a new rgba buffer here.
|
||||
stream.add(EventToUI::Rgba);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user