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

RFC: Allow prev_timer to be set to nothing #131

Merged
merged 2 commits into from
Jul 2, 2021

Conversation

GregPlowman
Copy link
Contributor

The circular self-reference of prev_timer field can cause problems in some circumstances.
For example, exporting TimerOutput using JLD causes StackOverflowError.
Workaround for #40

I realise this is an issue for JLD rather than TimerOutputs, so marking as RFC. However, it seems to provide a workaround with little impact on TimerOutputs.

Change type of prev_timer to Union{TimerOutput,Nothing} which allows setting it to nothing, breaking the circularity.
It also seems consistent that prev_timer == nothing whenever prev_timer_label == "".

Before saving to JLD, set prev_timer to nothing.

Change prev_timer type to Union{TimerOutput,Nothing}
Allow prev_time to be set to nothing to break circularity which can cause issues in some circumstances
For example when saving to JLD
@KristofferC
Copy link
Owner

Seems like a good idea. Thanks.

@KristofferC KristofferC merged commit 0bd3ef8 into KristofferC:master Jul 2, 2021
@GregPlowman GregPlowman deleted the glp/noncircular branch July 2, 2021 09:07
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