Change summary
crates/gpui/src/platform/linux/headless/client.rs | 6 +++++-
crates/gpui/src/platform/linux/wayland/client.rs | 9 ++++++++-
crates/gpui/src/platform/linux/x11/client.rs | 9 ++++++++-
crates/gpui/src/platform/windows/dispatcher.rs | 9 ++++++++-
4 files changed, 29 insertions(+), 4 deletions(-)
Detailed changes
@@ -32,7 +32,11 @@ impl HeadlessClient {
.insert_source(main_receiver, |event, _, _: &mut HeadlessClient| {
if let calloop::channel::Event::Msg(runnable) = event {
match runnable {
- crate::RunnableVariant::Meta(runnable) => runnable.run(),
+ crate::RunnableVariant::Meta(runnable) => {
+ if runnable.metadata().is_app_alive() {
+ runnable.run();
+ }
+ }
crate::RunnableVariant::Compat(runnable) => runnable.run(),
};
}
@@ -502,7 +502,14 @@ impl WaylandClient {
let start = Instant::now();
let mut timing = match runnable {
RunnableVariant::Meta(runnable) => {
- let location = runnable.metadata().location;
+ let metadata = runnable.metadata();
+ let location = metadata.location;
+
+ if !metadata.is_app_alive() {
+ drop(runnable);
+ return;
+ }
+
let timing = TaskTiming {
location,
start,
@@ -316,7 +316,14 @@ impl X11Client {
let start = Instant::now();
let mut timing = match runnable {
RunnableVariant::Meta(runnable) => {
- let location = runnable.metadata().location;
+ let metadata = runnable.metadata();
+ let location = metadata.location;
+
+ if !metadata.is_app_alive() {
+ drop(runnable);
+ return;
+ }
+
let timing = TaskTiming {
location,
start,
@@ -73,7 +73,14 @@ impl WindowsDispatcher {
let mut timing = match runnable {
RunnableVariant::Meta(runnable) => {
- let location = runnable.metadata().location;
+ let metadata = runnable.metadata();
+ let location = metadata.location;
+
+ if !metadata.is_app_alive() {
+ drop(runnable);
+ return;
+ }
+
let timing = TaskTiming {
location,
start,