mirror of
https://github.com/Burrit0z/kai
synced 2025-07-01 04:36:48 +00:00
huge trash, memory leak forever
This commit is contained in:
@ -38,13 +38,19 @@ long long lastPercentage;
|
||||
}*/
|
||||
|
||||
for(KAIBatteryCell *cell in addedCells) {
|
||||
if(![devices containsObject:cell.device]) {
|
||||
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 removeFromSuperview];
|
||||
//[addedCells removeObject:cell];
|
||||
}
|
||||
}
|
||||
|
||||
for (BCBatteryDevice *device in devices) {
|
||||
@ -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];
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user