mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-25 23:35:45 +00:00
Fix asserts, don't use freed memory.
This commit is contained in:
parent
2713119249
commit
8adc7ac00f
@ -309,12 +309,12 @@ void ProcessList_remove(ProcessList* this, Process* p) {
|
||||
assert(Vector_indexOf(this->processes, p, Process_pidCompare) != -1);
|
||||
assert(Hashtable_get(this->processTable, p->pid) != NULL);
|
||||
Process* pp = Hashtable_remove(this->processTable, p->pid);
|
||||
assert(pp == p);
|
||||
assert(pp == p); (void)pp;
|
||||
int pid = p->pid;
|
||||
int index = Vector_indexOf(this->processes, p, Process_pidCompare);
|
||||
assert(index != -1);
|
||||
Vector_remove(this->processes, index);
|
||||
assert(Vector_indexOf(this->processes, p, Process_pidCompare) == -1);
|
||||
assert(Hashtable_get(this->processTable, p->pid) == NULL);
|
||||
assert(Hashtable_get(this->processTable, pid) == NULL); (void)pid;
|
||||
}
|
||||
|
||||
Process* ProcessList_get(ProcessList* this, int index) {
|
||||
|
Loading…
Reference in New Issue
Block a user