diff options
author | DLFW <daniel@llin.info> | 2022-01-19 21:38:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-19 15:38:20 -0500 |
commit | b551042efca2c5a0d8d3ca12860723b777b55e17 (patch) | |
tree | 7504c5cb776a3db86228fa8a33c40fff582146ff /src/context | |
parent | b8991d885c7513d83a19cb0b10e92efdfe1c0f23 (diff) |
fix: disarm spawn bomb (#128)
The preview-removed-hook was called in each main loop cycle if no
preview area was shown and a removed-hook was configured.
Diffstat (limited to 'src/context')
-rw-r--r-- | src/context/app_context.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/context/app_context.rs b/src/context/app_context.rs index 79335c2..8c5f907 100644 --- a/src/context/app_context.rs +++ b/src/context/app_context.rs @@ -163,7 +163,11 @@ impl AppContext { self.call_preview_shown_hook(new.clone()) } } - None => self.call_preview_removed_hook(), + None => { + if !self.preview_area.is_none() { + self.call_preview_removed_hook() + } + } } self.preview_area = new_preview_area } |