Skip to content

Commit

Permalink
do 265 cleanup on toxav kill
Browse files Browse the repository at this point in the history
  • Loading branch information
zoff99 committed Mar 17, 2024
1 parent 92d82da commit cf34a0e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions amalgamation/toxcore_amalgamation.c
Original file line number Diff line number Diff line change
Expand Up @@ -75632,6 +75632,11 @@ void toxav_kill(ToxAV *av)
pthread_mutex_unlock(av->toxav_endcall_mutex);
pthread_mutex_destroy(av->toxav_endcall_mutex);

#ifdef HAVE_H265_ENCODER
// HINT: to prevent leaks, cleanup x265
x265_cleanup();
#endif

free(av);
av = nullptr;
}
Expand Down Expand Up @@ -82659,8 +82664,6 @@ static void vc_kill_encoder_h265(VCSession *vc)
x265_picture_free(vc->h265_in_pic);
x265_picture_free(vc->h265_out_pic);
x265_encoder_close(vc->h265_encoder);
// HINT: to prevent leaks, cleanup x265
x265_cleanup();
}
#endif

Expand Down
2 changes: 0 additions & 2 deletions toxav/codecs/h264/codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -2078,8 +2078,6 @@ static void vc_kill_encoder_h265(VCSession *vc)
x265_picture_free(vc->h265_in_pic);
x265_picture_free(vc->h265_out_pic);
x265_encoder_close(vc->h265_encoder);
// HINT: to prevent leaks, cleanup x265
x265_cleanup();
}
#endif

Expand Down
5 changes: 5 additions & 0 deletions toxav/toxav.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,11 @@ void toxav_kill(ToxAV *av)
pthread_mutex_unlock(av->toxav_endcall_mutex);
pthread_mutex_destroy(av->toxav_endcall_mutex);

#ifdef HAVE_H265_ENCODER
// HINT: to prevent leaks, cleanup x265
x265_cleanup();
#endif

free(av);
av = nullptr;
}
Expand Down

0 comments on commit cf34a0e

Please sign in to comment.