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

Memory leak on LightFactory when IP not legal #1

Closed
OriNachum opened this issue Mar 3, 2019 · 1 comment
Closed

Memory leak on LightFactory when IP not legal #1

OriNachum opened this issue Mar 3, 2019 · 1 comment

Comments

@OriNachum
Copy link

I found an issue when trying to generate a light with an illegal IP. This can happen when there are non-bulbs, or network issues, and the attempt to create a Light fails.
It can be solved by test-catch on await communicator + new Light lines:

                try
		{
			var payload = await communicator
				.CommunicateAsync<StateVersionResponsePayload>(request, cancellationToken)
				.ConfigureAwait(false);
			
			light = new Light(address, payload.Product, payload.Version, communicator, requestFactory);
			return light;
		}
		catch (Exception ex)
		{
			communicator.Dispose();
			throw;
		}
@OllieDay
Copy link
Owner

OllieDay commented Mar 4, 2019

Good find!

I've pushed v1.0.1 with this fix to NuGet.

Thanks!

@OllieDay OllieDay closed this as completed Mar 4, 2019
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

2 participants