From b7f0a4fed2bf0249c9bffc3cc185688748ab3058 Mon Sep 17 00:00:00 2001 From: Felix Domke Date: Tue, 10 Feb 2009 15:02:13 +0100 Subject: [PATCH] stop idle timer when removing a harddisk --- lib/python/Components/Harddisk.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/python/Components/Harddisk.py b/lib/python/Components/Harddisk.py index 44245ebb..470055e4 100644 --- a/lib/python/Components/Harddisk.py +++ b/lib/python/Components/Harddisk.py @@ -21,6 +21,7 @@ class Harddisk: s_minor = int(tmp[1]) self.max_idle_time = 0 self.idle_running = False + self.timer = None for disc in listdir("/dev/discs"): path = readlink('/dev/discs/'+disc) devidex = '/dev/discs/'+disc+'/' @@ -37,6 +38,11 @@ class Harddisk: def __lt__(self, ob): return self.device < ob.device + def stop(self): + if self.timer: + self.timer.stop() + self.timer.callback.remove(self.runIdle) + def bus(self): ide_cf = self.device.find("hd") == 0 and self.devidex2.find("host0") == -1 # 7025 specific internal = self.device.find("hd") == 0 @@ -454,6 +460,7 @@ class HarddiskManager: idx = 0 for hdd in self.hdd: if hdd.device == device: + self.hdd[x].stop() del self.hdd[idx] break SystemInfo["Harddisk"] = len(self.hdd) > 0 -- 2.30.2