summaryrefslogtreecommitdiffstats
path: root/Process.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2015-02-20 14:52:10 -0200
committerHisham Muhammad <hisham@gobolinux.org>2015-02-20 14:52:10 -0200
commit6f868b00c02ef241216e7b95e0a09c38760c2f16 (patch)
tree905037b792a89fd8a2f6781e2656edf73a0fa590 /Process.c
parentf97d1bc54af13e7c801bf6d83e95661f25695719 (diff)
Fix allocation of processes. Closes #166.
Diffstat (limited to 'Process.c')
-rw-r--r--Process.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/Process.c b/Process.c
index 31dd9659..2ca7a147 100644
--- a/Process.c
+++ b/Process.c
@@ -647,14 +647,12 @@ static void Process_display(Object* cast, RichString* out) {
assert(out->chlen > 0);
}
-void Process_delete(Object* cast) {
- Process* this = (Process*) cast;
+void Process_done(Process* this) {
assert (this != NULL);
free(this->comm);
#ifdef HAVE_CGROUP
free(this->cgroup);
#endif
- free(this);
}
ObjectClass Process_class = {
@@ -664,9 +662,7 @@ ObjectClass Process_class = {
.compare = Process_compare
};
-Process* Process_new(struct Settings_* settings) {
- Process* this = calloc(1, sizeof(Process));
- Object_setClass(this, Class(Process));
+void Process_init(Process* this, struct Settings_* settings) {
this->pid = 0;
this->settings = settings;
this->tag = false;
@@ -682,7 +678,6 @@ Process* Process_new(struct Settings_* settings) {
this->cgroup = NULL;
#endif
if (Process_getuid == -1) Process_getuid = getuid();
- return this;
}
void Process_toggleTag(Process* this) {

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