4

I am trying to disconnect the call by pressing back button and the application crashes with this error. I am using Pierre Chabardes 's AndroidRTC app on eclipse. https://github.com/pchab/AndroidRTC

I have also builded the latest WebRTC libjingle_peerconnection_so.so & libjingle_peerconnection.jar through linux machine.

04-10 12:20:16.695: E/rtc(29060): #
04-10 12:20:16.695: E/rtc(29060): # Fatal error in ../../talk/app/webrtc/java/jni/peerconnection_jni.cc, line 926
04-10 12:20:16.695: E/rtc(29060): # Check failed: 0 == (reinterpret_cast<MediaSourceInterface*>(j_p))->Release() (0 vs. 1)
04-10 12:20:16.695: E/rtc(29060): # Unexpected refcount.
04-10 12:20:16.695: E/rtc(29060): #
04-10 12:20:16.695: A/libc(29060): Fatal signal 6 (SIGABRT), code -6 in tid 29060 
Haresh Chaudhary
  • 4,390
  • 1
  • 34
  • 57

1 Answers1

6

After going through multiple hours of testing, I had figured out that the Socket which was initially created was not closed properly in the onDestroy() method on line .

Its something like this there:

public void onDestroy() {
    for (Peer peer : peers.values()) {
        peer.pc.dispose();
    }
    videoSource.dispose();
    factory.dispose();
    client.disconnect();
    client.close();
}

it needs to be close by this way :

public void onDestroy() {
    for (Peer peer : peers.values()) {
        peer.pc.dispose();
    }
    videoSource.dispose();
    factory.dispose();
    client.off();<---- You need to turn OFF and then disconnect  and then close it.
    client.disconnect();
    client.close();
}
Haresh Chaudhary
  • 4,390
  • 1
  • 34
  • 57