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

Fix Connection.execute not to leak, add test for this #57

Merged
merged 2 commits into from
Aug 2, 2016

Conversation

Lekensteyn
Copy link
Contributor

Adds a test that detects the issue from #23 and adds an alternative fix that avoids the callback leak in #54.

Ensures that the modifications to the execute callback handling does not
accidentally trigger other events.

Sends a different event before the actual response to ensure that
englercj#23 will not occur again.
A session is identified by the variable 'uuid'. Multiple command
requests/responses are possible, hence the callback was registered only
once before. These were however not cleaned up.

Take a different approach, always register an event handler for the
session and check in the callback whether the response matched the
request. This results in a number of calls that grows linearly to the
number of open requests, but this number is usually small anyway.

Fixes englercj#54
@Lekensteyn Lekensteyn changed the title Fix execute Fix Connection.execute not to leak, add test for this Aug 2, 2016
@englercj englercj merged commit 48b45fd into englercj:master Aug 2, 2016
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

Successfully merging this pull request may close these issues.

2 participants