Fix device cleanup

Summary: Found some code duplication causing old devices not entirely to be cleaned up as they should

Reviewed By: nikoant

Differential Revision: D26422665

fbshipit-source-id: f57757f7260ac5de17edd80e9f66cc844d1a6213
This commit is contained in:
Michel Weststrate
2021-02-12 06:42:34 -08:00
committed by Facebook GitHub Bot
parent 4964966b91
commit b4ec0d62a5
3 changed files with 1 additions and 8 deletions

View File

@@ -126,12 +126,6 @@ export default class BaseDevice {
}; };
} }
teardown() {
for (const instance of this.sandyPluginStates.values()) {
instance.destroy();
}
}
addLogListener(callback: DeviceLogListener): Symbol { addLogListener(callback: DeviceLogListener): Symbol {
const id = Symbol(); const id = Symbol();
this.logListeners.set(id, callback); this.logListeners.set(id, callback);

View File

@@ -218,7 +218,7 @@ export default (state: State = INITAL_STATE, action: Actions): State => {
if (!deviceSerials.has(device.serial)) { if (!deviceSerials.has(device.serial)) {
return true; return true;
} else { } else {
device.teardown(); device.destroy();
return false; return false;
} }
}); });

View File

@@ -31,7 +31,6 @@ import Client from '../../Client';
import {State} from '../../reducers'; import {State} from '../../reducers';
import {brandColors, brandIcons, colors} from '../../ui/components/colors'; import {brandColors, brandIcons, colors} from '../../ui/components/colors';
import {showEmulatorLauncher} from './LaunchEmulator'; import {showEmulatorLauncher} from './LaunchEmulator';
import ArchivedDevice from '../../devices/ArchivedDevice';
const {Text, Link, Title} = Typography; const {Text, Link, Title} = Typography;