mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-24 11:46:31 +00:00
Stop scanner interval before starting a new one
This ensures there are no orphaned intervals running.
This commit is contained in:
parent
728524f6e3
commit
fdcc5d6b71
@ -133,6 +133,10 @@ driveScanner.service('DriveScannerService', function($q, $interval, $timeout) {
|
||||
});
|
||||
};
|
||||
|
||||
// Make sure any pending interval is cancelled
|
||||
// to avoid potential memory leaks.
|
||||
self.stop();
|
||||
|
||||
// Call fn after in the next process tick
|
||||
// to be able to capture the first run
|
||||
// in unit tests.
|
||||
|
Loading…
x
Reference in New Issue
Block a user