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

Commit b3803859 authored by Sonny Sasaka's avatar Sonny Sasaka Committed by Gerrit Code Review
Browse files

Merge "Floss: Fix deadlock in callback removal"

parents 3b083f8d 02ea306c
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -140,15 +140,11 @@ impl DisconnectWatcher {
            return false;
        }

        match self.callbacks.lock().unwrap().get(&address).and_then(|m| m.get(&target_id)) {
        let mut callbacks = self.callbacks.lock().unwrap();
        match callbacks.get(&address).and_then(|m| m.get(&target_id)) {
            Some(cb) => {
                cb(target_id);
                let _ = self
                    .callbacks
                    .lock()
                    .unwrap()
                    .get_mut(&address)
                    .and_then(|m| m.remove(&target_id));
                let _ = callbacks.get_mut(&address).and_then(|m| m.remove(&target_id));
                true
            }
            None => false,
+0 −1
Original line number Diff line number Diff line
@@ -717,7 +717,6 @@ impl BluetoothGatt {
    }

    pub fn init_profiles(&mut self, tx: Sender<Message>, adapter: Arc<Mutex<Box<Bluetooth>>>) {
        println!("woot woot");
        self.gatt = Gatt::new(&self.intf.lock().unwrap());
        self.adapter = Some(adapter);