diff --git a/jicofo/src/main/java/org/jitsi/jicofo/conference/ParticipantInviteRunnable.java b/jicofo/src/main/java/org/jitsi/jicofo/conference/ParticipantInviteRunnable.java index 348bf6ade0..3fd67bfa51 100644 --- a/jicofo/src/main/java/org/jitsi/jicofo/conference/ParticipantInviteRunnable.java +++ b/jicofo/src/main/java/org/jitsi/jicofo/conference/ParticipantInviteRunnable.java @@ -387,6 +387,8 @@ private boolean doInviteOrReinvite(Offer offer, ColibriAllocation colibriAllocat jingleSession.terminate(Reason.UNDEFINED, null, false); } jingleSession = participant.createNewJingleSession(); + // Save a reference to jingleSession to prevent it from being garbage collected. Temporary fix! + participant.setJingleSessionTmp(jingleSession); logger.info("Sending session-initiate to: " + participant.getMucJid() + " sources=" + sources); ack = jingleSession.initiateSession( offer.getContents(), diff --git a/jicofo/src/main/kotlin/org/jitsi/jicofo/conference/Participant.kt b/jicofo/src/main/kotlin/org/jitsi/jicofo/conference/Participant.kt index e6d746408e..3133237b5e 100644 --- a/jicofo/src/main/kotlin/org/jitsi/jicofo/conference/Participant.kt +++ b/jicofo/src/main/kotlin/org/jitsi/jicofo/conference/Participant.kt @@ -80,6 +80,9 @@ open class Participant @JvmOverloads constructor( addContext("participant", endpointId) } + // Save a reference to jingleSession to prevent it from being garbage collected. Temporary fix! + var jingleSessionTmp: JingleSession? = null + /** * The layer which keeps track of which sources have been signaled to this participant. */