Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2fe318ba authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "floss: Abort freshness_check JoinHandle before dropping."

parents 97914313 5430bbeb
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -481,8 +481,11 @@ impl Bluetooth {
    /// Check whether found devices are still fresh. If they're outside the
    /// freshness window, send a notification to clear the device from clients.
    pub(crate) fn trigger_freshness_check(&mut self) {
        // Drop previous joinhandle
        if let Some(ref handle) = self.freshness_check {
            // Abort and drop the previous JoinHandle.
            handle.abort();
            self.freshness_check = None;
        }

        // A found device is considered fresh if:
        // * It was last seen less than |FOUND_DEVICE_FRESHNESS| ago.