paullouisageneau / libdatachannel

C/C++ WebRTC network library featuring Data Channels, Media Transport, and WebSockets
https://libdatachannel.org/
Mozilla Public License 2.0
1.73k stars 353 forks source link

rtc::PeerConnection::close() causes the application to crash when called multiple times #1241

Open vietdungdev0106 opened 1 month ago

vietdungdev0106 commented 1 month ago

Hello author. I encountered a problem when I closed 1 Peer multiple times and the error log is below. I wonder if anyone has the same error as me?

(std::__ndk1::function<void (rtc::PeerConnection::State)>::operator()(rtc::PeerConnection::State) const+60) (BuildId: 17c6e24c2208acb2d1e627a27f8a3f60e03ad59a) (_ZNK3rtc21synchronized_callbackIJNS14PeerConnection5StateEEE4callES2+104) (BuildId: 17c6e24c2208acb2d1e627a27f8a3f60e03ad59a) (_ZNK3rtc21synchronized_callbackIJNS14PeerConnection5StateEEEclES2+80) (BuildId: 17c6e24c2208acb2d1e627a27f8a3f60e03ad59a) (rtc::impl::PeerConnection::changeState(rtc::PeerConnection::State)+588) (BuildId: 17c6e24c2208acb2d1e627a27f8a3f60e03ad59a) (rtc::impl::PeerConnection::closeTransports()+260) (BuildId: 17c6e24c2208acb2d1e627a27f8a3f60e03ad59a) (rtc::impl::PeerConnection::remoteClose()+212) (BuildId: 17c6e24c2208acb2d1e627a27f8a3f60e03ad59a) (rtc::impl::PeerConnection::close()+372) (BuildId: 17c6e24c2208acb2d1e627a27f8a3f60e03ad59a) (rtc::PeerConnection::close()+52) (BuildId: 17c6e24c2208acb2d1e627a27f8a3f60e03ad59a)

paullouisageneau commented 1 month ago

Calling close() multiple times shouldn't be an issue. Are you sure nothing causes a crash in the onStateChange() user callback?