summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2014-11-27 17:48:38 -0200
committerHisham Muhammad <hisham@gobolinux.org>2014-11-27 17:48:38 -0200
commitcda6bdd56b54f4ab9da15e559edce9591ef12ce1 (patch)
tree1f420c7910e3d6acbef594a7391e8fe91545eb63
parentff4d1b466fba116d0750a815a1d517dbc24b4b43 (diff)
Add ProcessList_delete to the variable interface.
-rw-r--r--ProcessList.c4
-rw-r--r--ProcessList.h3
-rw-r--r--linux/LinuxProcessList.c5
-rw-r--r--unsupported/UnsupportedProcessList.c5
-rw-r--r--unsupported/UnsupportedProcessList.h2
5 files changed, 16 insertions, 3 deletions
diff --git a/ProcessList.c b/ProcessList.c
index ed9dbca2..d164fa05 100644
--- a/ProcessList.c
+++ b/ProcessList.c
@@ -129,6 +129,7 @@ typedef struct ProcessList_ {
} ProcessList;
ProcessList* ProcessList_new(UsersTable* ut, Hashtable* pidWhiteList);
+void ProcessList_delete(ProcessList* pl);
void ProcessList_scan(ProcessList* pl);
}*/
@@ -211,13 +212,12 @@ ProcessList* ProcessList_init(ProcessList* this, UsersTable* usersTable, Hashtab
return this;
}
-void ProcessList_delete(ProcessList* this) {
+void ProcessList_done(ProcessList* this) {
Hashtable_delete(this->processTable);
Vector_delete(this->processes);
Vector_delete(this->processes2);
free(this->cpus);
free(this->fields);
- free(this);
}
void ProcessList_setPanel(ProcessList* this, Panel* panel) {
diff --git a/ProcessList.h b/ProcessList.h
index 2bd5788a..916039c3 100644
--- a/ProcessList.h
+++ b/ProcessList.h
@@ -124,6 +124,7 @@ typedef struct ProcessList_ {
} ProcessList;
ProcessList* ProcessList_new(UsersTable* ut, Hashtable* pidWhiteList);
+void ProcessList_delete(ProcessList* pl);
void ProcessList_scan(ProcessList* pl);
@@ -133,7 +134,7 @@ extern const char *ProcessList_treeStrUtf8[TREE_STR_COUNT];
ProcessList* ProcessList_init(ProcessList* this, UsersTable* usersTable, Hashtable* pidWhiteList);
-void ProcessList_delete(ProcessList* this);
+void ProcessList_done(ProcessList* this);
void ProcessList_setPanel(ProcessList* this, Panel* panel);
diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c
index c549667e..0b46d119 100644
--- a/linux/LinuxProcessList.c
+++ b/linux/LinuxProcessList.c
@@ -77,6 +77,11 @@ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList) {
return this;
}
+void ProcessList_delete(ProcessList* this) {
+ ProcessList_done(this);
+ free(this);
+}
+
static ssize_t xread(int fd, void *buf, size_t count) {
// Read some bytes. Retry on EINTR and when we don't get as many bytes as we requested.
size_t alreadyRead = 0;
diff --git a/unsupported/UnsupportedProcessList.c b/unsupported/UnsupportedProcessList.c
index 6fdca53f..fca9a760 100644
--- a/unsupported/UnsupportedProcessList.c
+++ b/unsupported/UnsupportedProcessList.c
@@ -26,6 +26,11 @@ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList) {
return this;
}
+void ProcessList_delete(ProcessList* this) {
+ ProcessList_done(this);
+ free(this);
+}
+
void ProcessList_scan(ProcessList* this) {
(void) this;
// stub!
diff --git a/unsupported/UnsupportedProcessList.h b/unsupported/UnsupportedProcessList.h
index d95c8e5c..ac9d99fe 100644
--- a/unsupported/UnsupportedProcessList.h
+++ b/unsupported/UnsupportedProcessList.h
@@ -13,6 +13,8 @@ in the source distribution for its full text.
ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList);
+void ProcessList_delete(ProcessList* this);
+
void ProcessList_scan(ProcessList* this);
#endif

© 2014-2024 Faster IT GmbH | imprint | privacy policy