mirror of https://github.com/xzeldon/htop.git
only reinit initializable meters
This commit is contained in:
parent
219bb9ccff
commit
b57b7e9a9e
6
Header.c
6
Header.c
|
@ -136,11 +136,13 @@ void Header_defaultMeters(Header* this) {
|
||||||
void Header_reinit(Header* this) {
|
void Header_reinit(Header* this) {
|
||||||
for (int i = 0; i < Vector_size(this->leftMeters); i++) {
|
for (int i = 0; i < Vector_size(this->leftMeters); i++) {
|
||||||
Meter* meter = (Meter*) Vector_get(this->leftMeters, i);
|
Meter* meter = (Meter*) Vector_get(this->leftMeters, i);
|
||||||
meter->type->init(meter);
|
if (meter->type->init)
|
||||||
|
meter->type->init(meter);
|
||||||
}
|
}
|
||||||
for (int i = 0; i < Vector_size(this->rightMeters); i++) {
|
for (int i = 0; i < Vector_size(this->rightMeters); i++) {
|
||||||
Meter* meter = (Meter*) Vector_get(this->rightMeters, i);
|
Meter* meter = (Meter*) Vector_get(this->rightMeters, i);
|
||||||
meter->type->init(meter);
|
if (meter->type->init)
|
||||||
|
meter->type->init(meter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue