Skip to content

Commit 7f90049

Browse files
authored
fix: Temporary fix for JingleSession-s being GC too early (#1019)
JingleSessions register with JingleIqHandler which saves a weak reference and there are no other references to the object until the session is accepted and saved as Participant.jingleSession. If the weak reference expires before session-accept is received the session fails to establish. This is a quick and dirty fix, a proper solution will follow later.
1 parent fe8c958 commit 7f90049

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

jicofo/src/main/java/org/jitsi/jicofo/conference/ParticipantInviteRunnable.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,8 @@ private boolean doInviteOrReinvite(Offer offer, ColibriAllocation colibriAllocat
387387
jingleSession.terminate(Reason.UNDEFINED, null, false);
388388
}
389389
jingleSession = participant.createNewJingleSession();
390+
// Save a reference to jingleSession to prevent it from being garbage collected. Temporary fix!
391+
participant.setJingleSessionTmp(jingleSession);
390392
logger.info("Sending session-initiate to: " + participant.getMucJid() + " sources=" + sources);
391393
ack = jingleSession.initiateSession(
392394
offer.getContents(),

jicofo/src/main/kotlin/org/jitsi/jicofo/conference/Participant.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ open class Participant @JvmOverloads constructor(
8080
addContext("participant", endpointId)
8181
}
8282

83+
// Save a reference to jingleSession to prevent it from being garbage collected. Temporary fix!
84+
var jingleSessionTmp: JingleSession? = null
85+
8386
/**
8487
* The layer which keeps track of which sources have been signaled to this participant.
8588
*/

0 commit comments

Comments
 (0)