diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2015-02-20 14:52:10 -0200 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2015-02-20 14:52:10 -0200 |
commit | 6f868b00c02ef241216e7b95e0a09c38760c2f16 (patch) | |
tree | 905037b792a89fd8a2f6781e2656edf73a0fa590 /Process.c | |
parent | f97d1bc54af13e7c801bf6d83e95661f25695719 (diff) |
Fix allocation of processes. Closes #166.
Diffstat (limited to 'Process.c')
-rw-r--r-- | Process.c | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -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) { |