Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emitter must be optional? #203

Open
krom-xr opened this issue Jul 5, 2023 · 0 comments
Open

emitter must be optional? #203

krom-xr opened this issue Jul 5, 2023 · 0 comments

Comments

@krom-xr
Copy link

krom-xr commented Jul 5, 2023

Hello.
In file Emitter.js you have

	stop()
{
	//Remove listeners
	this.emitter.removeAllListeners();
	//Free mem
	this.emitter = null;
}

in file SDPManagerUnified.js you have

	stop()
{
             ...
	//Stop SDPManager
	super.stop();
             ...		
}

But also you have method 'renegotiate'

renegotiate() 
{
	//Check if we already need to renegotiate
	if (!this.renegotiationNeeded && ["initial","stable"].includes(this.state))
	{
		//Set flag
		this.renegotiationNeeded = true;
		//On next tick
		setTimeout(()=>{
			//Clean flag
			this.renegotiationNeeded = false;
			//Emit event
			this.emitter.emit("renegotiationneeded",this.transport);
		},0);
	}
}

And there in setTimeout you may get an error, because this.emitter is null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant