mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
module-rt: first join and then free memory
First join the thread and then free the memory or else we might free the memory while the thread is starting up and we crash.
This commit is contained in:
parent
cd201aca22
commit
ee5a6f16f9
1 changed files with 4 additions and 1 deletions
|
|
@ -796,6 +796,9 @@ static int impl_join(void *object, struct spa_thread *thread, void **retval)
|
|||
struct impl *impl = object;
|
||||
pthread_t pt = (pthread_t)thread;
|
||||
struct thread *thr;
|
||||
int res;
|
||||
|
||||
res = pthread_join(pt, retval);
|
||||
|
||||
pthread_mutex_lock(&impl->lock);
|
||||
if ((thr = find_thread_by_pt(impl, pt)) != NULL) {
|
||||
|
|
@ -804,7 +807,7 @@ static int impl_join(void *object, struct spa_thread *thread, void **retval)
|
|||
}
|
||||
pthread_mutex_unlock(&impl->lock);
|
||||
|
||||
return pthread_join(pt, retval);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue