Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
spawn: free the spawns list in spawn_done()
  • Loading branch information
perexg committed Jan 1, 2016
1 parent a27ed2e commit 0a64e3b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/spawn.c
Expand Up @@ -649,11 +649,18 @@ void spawn_init(void)

void spawn_done(void)
{
spawn_t *s;

spawn_pipe_running = 0;
pthread_kill(spawn_pipe_tid, SIGTERM);
pthread_join(spawn_pipe_tid, NULL);
tvh_pipe_close(&spawn_pipe_error);
tvh_pipe_close(&spawn_pipe_info);
free(spawn_error_buf);
free(spawn_info_buf);
while ((s = LIST_FIRST(&spawns)) != NULL) {
LIST_REMOVE(s, link);
free((char *)s->name);
free(s);
}
}

0 comments on commit 0a64e3b

Please sign in to comment.