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

Consider not returning event handles from methods #3

Open
sharwell opened this issue Jul 11, 2015 · 0 comments
Open

Consider not returning event handles from methods #3

sharwell opened this issue Jul 11, 2015 · 0 comments

Comments

@sharwell
Copy link
Member

If event handles are returned from methods, it's easy to forget to dispose of them in cases where the event isn't required. Consider returning them via out parameters instead, so they are not allocated unless they are actually going to be used.

Another alternative is creating two methods for each of the current ones, one which returns void and another which performs the same operation but returns an event handle.

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