mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-13 04:34:35 +03:00
Add ScreenSettings_delete helper
This commit is contained in:
10
Settings.c
10
Settings.c
@ -75,9 +75,7 @@ void Settings_delete(Settings* this) {
|
||||
free(this->hColumns);
|
||||
if (this->screens) {
|
||||
for (unsigned int i = 0; this->screens[i]; i++) {
|
||||
free(this->screens[i]->name);
|
||||
free(this->screens[i]->fields);
|
||||
free(this->screens[i]);
|
||||
ScreenSettings_delete(this->screens[i]);
|
||||
}
|
||||
free(this->screens);
|
||||
}
|
||||
@ -285,6 +283,12 @@ ScreenSettings* Settings_newScreen(Settings* this, const char* name, const char*
|
||||
return ss;
|
||||
}
|
||||
|
||||
void ScreenSettings_delete(ScreenSettings* this) {
|
||||
free(this->name);
|
||||
free(this->fields);
|
||||
free(this);
|
||||
}
|
||||
|
||||
static ScreenSettings* Settings_defaultScreens(Settings* this) {
|
||||
if (this->nScreens)
|
||||
return this->screens[0];
|
||||
|
Reference in New Issue
Block a user