public void Cleanup()
{
foreach(var entry in Directory.GetDirectories(Directory.GetParent(emulatorTemporaryPath).FullName)
.Where(x => x != emulatorTemporaryPath && x.StartsWith(otherEmulatorTempPrefix, StringComparison.Ordinal)
&& !x.EndsWith(CrashSuffix, StringComparison.Ordinal)))
{
var pid = entry.Substring(otherEmulatorTempPrefix.Length);
int processId;
if(pid != null && int.TryParse(pid, out processId) && IsProcessAlive(processId))
{
continue;
}
ClearDirectory(entry);
}
}