gst1-java-core icon indicating copy to clipboard operation
gst1-java-core copied to clipboard

WebRTCBin.createAnswer() callback not called sporadically (promise garbage collected)

Open jw-tecuri opened this issue 2 years ago • 4 comments

Looks like the promise which is used inside the method sometimes gets garbage collected before callback is called.

reproducible with:

webRtcBin.createAnswer(answer -> {
   System.out.println("ANSWER");
});
System.gc();

jw-tecuri avatar Jun 16 '23 14:06 jw-tecuri

Yes, think I can see where the problem lies there. Most of the webrrc code was donated by someone who has not contributed for some time. Few options to consider to fix. Do you want to take it on?

neilcsmith-net avatar Jun 16 '23 16:06 neilcsmith-net

See pull request

jw-tecuri avatar Jun 18 '23 14:06 jw-tecuri

See pull request

Thanks. That might be the simplest way to fix this, although I have a slight concern on that implementation.

As and when we know whether there will be any further releases of this library, I'll review and/or merge.

neilcsmith-net avatar Jun 19 '23 13:06 neilcsmith-net

Extended the pull request with data channel support.

jw-tecuri avatar Jul 08 '23 08:07 jw-tecuri