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

Remove defer from for loops #122

Merged
merged 1 commit into from
Mar 15, 2023

Conversation

wneessen
Copy link
Owner

Fixes #121. defer in for loops can possibly lead to leaks.

The whole handling including the defer are now moved into anonymous functions outside the for loop and are called form the loop instead. This way the defer is handle when the inline function finishes

Fixes #121. `defer` in for loops can possibly lead to leaks.

The whole handling including the defer are now moved into anonymous functions outside the for loop and are called form the loop instead. This way the defer is handle when the inline function finishes
@wneessen wneessen linked an issue Mar 15, 2023 that may be closed by this pull request
@wneessen
Copy link
Owner Author

This also resolved PR #116

@wneessen wneessen merged commit 89fd5df into main Mar 15, 2023
@wneessen wneessen deleted the 121-using-defer-inside-for-loop-could-lead-to-leaks branch March 15, 2023 17:52
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.

Using defer inside for loop could lead to leaks
1 participant