Skip to content

Commit

Permalink
Update word2vec.c
Browse files Browse the repository at this point in the history
Free the dynamically allocated memory once all-thread is joined.
  • Loading branch information
vishalguptabit authored May 10, 2021
1 parent 9b8b580 commit 2cc66fe
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/word2vec.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@ void TrainModel() {
pthread_t *pt = (pthread_t *)malloc(num_threads * sizeof(pthread_t));
for (a = 0; a < num_threads; a++) pthread_create(&pt[a], NULL, TrainModelThread, (void *)a);
for (a = 0; a < num_threads; a++) pthread_join(pt[a], NULL);
free(pt);
#endif

fo = fopen(output_file, "wb");
Expand Down

0 comments on commit 2cc66fe

Please sign in to comment.