mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-05 02:38:31 +00:00
Fix greenbean example
The memory leak detector was crashing. When using gc() you shouldn't use the CheckForMemoryLeaks() function from inside the same function, due to how it runs the atexit handlers.
This commit is contained in:
parent
f590e96abd
commit
3f2a1b696e
4 changed files with 8 additions and 30 deletions
|
@ -68,8 +68,10 @@ static void _pthread_ungarbage(struct CosmoTib *tib) {
|
|||
tib->tib_garbages = 0;
|
||||
while (g->i--)
|
||||
((void (*)(intptr_t))g->p[g->i].fn)(g->p[g->i].arg);
|
||||
_weaken(free)(g->p);
|
||||
_weaken(free)(g);
|
||||
if (_weaken(free)) {
|
||||
_weaken(free)(g->p);
|
||||
_weaken(free)(g);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue