diff --git a/src/chat/main/server.c b/src/chat/main/server.c index 051d092..8e6f111 100644 --- a/src/chat/main/server.c +++ b/src/chat/main/server.c @@ -48,6 +48,7 @@ int main(void) if (accepted == -1) continue; pthread_create(&thread, NULL, why2_communicate_thread, &accepted); + why2_register_connection(accepted); //PUSH TO LIST } return 0; diff --git a/src/chat/misc.c b/src/chat/misc.c index 0bc7942..8dc14c5 100644 --- a/src/chat/misc.c +++ b/src/chat/misc.c @@ -152,6 +152,7 @@ void *why2_communicate_thread(void *arg) printf("User exited.\t%d\n", *((int*) arg)); //DEALLOCATION + remove_node(get_node(why2_communicate_thread)); close(*((int*) arg)); why2_deallocate(received);