Skip to content

Commit

Permalink
fix worker shutdown leak
Browse files Browse the repository at this point in the history
  • Loading branch information
Felipe cruz committed May 20, 2013
1 parent b45fc42 commit 504fdaa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/rio.c
Expand Up @@ -64,6 +64,11 @@ int main (int argc, char **args) {
break;
case 0:
run_worker(i, runtime->workers[i], runtime);
for (int i = 0; i < WORKERS; i++)
free(runtime->workers[i]);
free(runtime->workers);
close(runtime->server_fd);
free(runtime);
_exit(0);
default:
debug_print("Master after fork\n", runtime);
Expand All @@ -81,7 +86,6 @@ int main (int argc, char **args) {
if (INTERRUPTED != 0) {
debug_print("Sending terminate!\n", runtime);
send_command(runtime->publisher, "terminate");
//terminate workers and exit gracefully
break;
}

Expand Down Expand Up @@ -109,5 +113,4 @@ int main (int argc, char **args) {
free(runtime);

exit(0);

}

0 comments on commit 504fdaa

Please sign in to comment.