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 #2021: Memory leak with reactiveTimer and invalidateLater #2022

Merged
merged 3 commits into from Apr 19, 2018

Conversation

jcheng5
Copy link
Member

@jcheng5 jcheng5 commented Apr 18, 2018

reactiveTimer and invalidateLater had mechanisms to ensure they wouldn't have any effect once their owning sessions ended. But they didn't have anything in place to ensure that their closures could be garbage collected. This is because the underlying TimerCallbacks class I implemented way way back in the day, did not provide any way to truly unregister something that was scheduled for execution. This PR corrects that oversight and modifies reactiveTimer and invalidateLater to take advantage of that.

Testing notes

See #2021 for repro apps.

@jcheng5 jcheng5 requested a review from schloerke April 18, 2018 19:47
.funcs$remove(toRemoveId)
}
}
return(id %in% toRemoveIds)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This matches the prior if statement. Maybe a explicit return(TRUE) inside line 53 and return(FALSE) otherwise?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a vectorized result, so you can see which of the id's you passed in were actually found and removed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I guess I didn't make this explicit: you can pass in a vector multiple id's.

@jcheng5 jcheng5 merged commit ffe883a into master Apr 19, 2018
@jcheng5 jcheng5 deleted the joe/bugfix/timer-leak branch April 19, 2018 21:16
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.

None yet

2 participants