mirror of https://github.com/xzeldon/htop.git
Add ScreenSettings_delete helper
This commit is contained in:
parent
3cfdf66d9a
commit
df1914f429
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];
|
||||
|
|
|
@ -118,6 +118,8 @@ Settings* Settings_new(unsigned int initialCpuCount, Hashtable* dynamicColumns);
|
|||
|
||||
ScreenSettings* Settings_newScreen(Settings* this, const char* name, const char* line);
|
||||
|
||||
void ScreenSettings_delete(ScreenSettings* this);
|
||||
|
||||
void ScreenSettings_invertSortOrder(ScreenSettings* this);
|
||||
|
||||
void ScreenSettings_setSortKey(ScreenSettings* this, ProcessField sortKey);
|
||||
|
|
Loading…
Reference in New Issue