浏览代码

huge trash, memory leak forever

pull/1/head
Burrit0z 4 年前
父节点
当前提交
f71e68376c
共有 1 个文件被更改,包括 13 次插入5 次删除
  1. +13
    -5
      KAIBattery.mm

+ 13
- 5
KAIBattery.mm 查看文件

@@ -38,12 +38,18 @@ long long lastPercentage;
}*/

for(KAIBatteryCell *cell in addedCells) {
if(![devices containsObject:cell.device]) {
cell.device = nil;
[cell removeFromSuperview];
[self.displayingDevices removeObject:cell.label.text]; //lmaoo
if(cell.device!=nil) {
NSString *cellName = MSHookIvar<NSString *>(cell.device, "_name");
if(![addedCells containsObject:cellName]) {
cell.device = nil;
[cell removeFromSuperview];
[self.displayingDevices removeObject:cell.label.text]; //lmaoo
} else {
[cell updateInfo];
}
} else {
[cell updateInfo];
//[cell removeFromSuperview];
//[addedCells removeObject:cell];
}
}

@@ -86,8 +92,10 @@ long long lastPercentage;
} else if(!shouldAdd) {

if([self.displayingDevices containsObject:deviceName]) {
cell.device = nil;
[cell removeFromSuperview];
[self.displayingDevices removeObject:deviceName];
[addedCells removeObject:cell];
}

}

正在加载...
取消
保存