fix: Nested background threads leaking#56
Merged
Conversation
8e76441 to
7a6c014
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a critical issue where background threads in the file picker were leaking when the application was shut down or reinitialized. The fix implements proper cleanup mechanisms using a debouncer-based approach instead of the previous shutdown signal pattern.
- Replaces the shutdown signal approach with proper resource management using a debouncer wrapper
- Adds explicit cleanup functionality for stopping background monitors and cleaning up file pickers
- Implements automatic cleanup on Neovim exit via autocmd
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| lua/fff/rust/file_picker.rs | Refactors background thread management to use debouncer-based cleanup instead of shutdown signals |
| lua/fff/rust/lib.rs | Adds cleanup functions and updates error handling for file picker operations |
| lua/fff/rust/error.rs | Simplifies error types and adds proper error logging |
| lua/fff/rust/tracing.rs | Simplifies error handling for directory creation |
| lua/fff/main.lua | Adds VimLeavePre autocmd for automatic cleanup and refactors function naming |
| lua/fff/fuzzy.lua | Exposes new cleanup_file_picker function |
Comments suppressed due to low confidence (1)
lua/fff/rust/file_picker.rs:167
- Explicit
drop(picker)is redundant sincetake()already transfers ownership and the value will be dropped automatically at the end of the scope.
fn from(file: &FileItem) -> Self {
7a6c014 to
258afa3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #49