Summary
The tokio::spawn handler task's JoinHandle is discarded, so the Chrome process and handler task may persist indefinitely if close() is not called or fails.
Location
- File:
src/core/browser.rs
- Line(s): 52–63, 119–125
Severity
Medium
Details
BrowserManager::new spawns a task that drives the chromiumoxide handler. The JoinHandle is discarded. There is no Drop implementation. If close() is not called (e.g., early return, panic), the Chrome process and spawned task persist indefinitely.
Suggested Fix
Store the JoinHandle and abort it in close(), and implement Drop:
struct BrowserManager {
browser: Browser,
page: Page,
headless: bool,
handler_task: tokio::task::JoinHandle<()>,
}
// In close(): self.handler_task.abort();
// Also implement Drop as a safety net.
Automated finding by repo-monitor
Summary
The
tokio::spawnhandler task'sJoinHandleis discarded, so the Chrome process and handler task may persist indefinitely ifclose()is not called or fails.Location
src/core/browser.rsSeverity
Medium
Details
BrowserManager::newspawns a task that drives thechromiumoxidehandler. TheJoinHandleis discarded. There is noDropimplementation. Ifclose()is not called (e.g., early return, panic), the Chrome process and spawned task persist indefinitely.Suggested Fix
Store the
JoinHandleand abort it inclose(), and implementDrop:Automated finding by repo-monitor