• Pascal Buhler's avatar
    rtpbin: Make cleaning up sources in rtp_session_on_timeout MT safe · ca6a512b
    Pascal Buhler authored
    Using _foreach_remove on the hashtable, while releasing the lock protecting
    that table inside the callback is not a good idea. The hashtable might
    then change (a source removed or added) while signals like on_timeout
    are being sent.
    
    This solution makes a copy of the table, performs the _foreach without
    actually removing any sources, but marks them for removal on a second
    iteration with the real list, but this time not letting go of the lock.
    
    Fixes #630452
    ca6a512b
rtpsource.c 45.9 KB