Only keep one self destruct timeout, ref #255
parent
feac3f069d
commit
45a89b9f1a
|
|
@ -117,6 +117,8 @@ class Room extends EventEmitter
|
|||
|
||||
this._peers = {};
|
||||
|
||||
this._selfDestructTimeout = null;
|
||||
|
||||
// Array of mediasoup Router instances.
|
||||
this._mediasoupRouters = mediasoupRouters;
|
||||
|
||||
|
|
@ -146,6 +148,11 @@ class Room extends EventEmitter
|
|||
|
||||
this._closed = true;
|
||||
|
||||
if (this._selfDestructTimeout)
|
||||
clearTimeout(this._selfDestructTimeout);
|
||||
|
||||
this._selfDestructTimeout = null;
|
||||
|
||||
this._chatHistory = null;
|
||||
|
||||
this._fileHistory = null;
|
||||
|
|
@ -411,7 +418,10 @@ class Room extends EventEmitter
|
|||
{
|
||||
logger.debug('selfDestructCountdown() started');
|
||||
|
||||
setTimeout(() =>
|
||||
if (this._selfDestructTimeout)
|
||||
clearTimeout(this._selfDestructTimeout);
|
||||
|
||||
this._selfDestructTimeout = setTimeout(() =>
|
||||
{
|
||||
if (this._closed)
|
||||
return;
|
||||
|
|
|
|||
Loading…
Reference in New Issue