diff options
author | Daniel Lange <DLange@git.local> | 2024-01-10 12:40:37 +0100 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2024-01-10 12:40:37 +0100 |
commit | 7271b076b82785ffca73ee9e4ae84cabb77018ee (patch) | |
tree | e8270dd60ec096bee8157dbadf029e15ed584592 /DynamicColumn.c | |
parent | f288666edc9180a2e81e6655951878124f321df6 (diff) | |
download | debian_htop-upstream.tar.gz debian_htop-upstream.tar.bz2 debian_htop-upstream.zip |
New upstream version 3.3.0upstream/3.3.0upstream
Diffstat (limited to 'DynamicColumn.c')
-rw-r--r-- | DynamicColumn.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/DynamicColumn.c b/DynamicColumn.c index bd038df..5f02174 100644 --- a/DynamicColumn.c +++ b/DynamicColumn.c @@ -12,6 +12,7 @@ in the source distribution for its full text. #include "DynamicColumn.h" #include <stddef.h> +#include <stdlib.h> #include "Platform.h" #include "RichString.h" @@ -19,7 +20,10 @@ in the source distribution for its full text. Hashtable* DynamicColumns_new(void) { - return Platform_dynamicColumns(); + Hashtable* dynamics = Platform_dynamicColumns(); + if (!dynamics) + dynamics = Hashtable_new(0, true); + return dynamics; } void DynamicColumns_delete(Hashtable* dynamics) { @@ -29,8 +33,14 @@ void DynamicColumns_delete(Hashtable* dynamics) { } } -const char* DynamicColumn_init(unsigned int key) { - return Platform_dynamicColumnInit(key); +const char* DynamicColumn_name(unsigned int key) { + return Platform_dynamicColumnName(key); +} + +void DynamicColumn_done(DynamicColumn* this) { + free(this->heading); + free(this->caption); + free(this->description); } typedef struct { |